hxt-9.3.1.16: A collection of tools for processing XML with Haskell.

Copyright | Copyright (C) 2005-2010 Uwe Schmidt
License | MIT
Maintainer | Uwe Schmidt (uwe\@fh-wedel.de)
Stability | stable
Portability | portable
Safe Haskell | Safe
Language | Haskell98

Data.Tree.NTree.TypeDefs

Description

Interface definition for trees

n-ary tree structure (rose trees)

Synopsis

- data NTree a = NTree a (NTrees a)
- type NTrees a = [NTree a]

# Documentation

data NTree a Source #

n-ary ordered tree (rose trees)

a tree consists of a node and a possible empty list of children. If the list of children is empty, the node is a leaf, else it's an inner node.

NTree implements Eq, Ord, Show and Read

Constructors

NTree a (NTrees a) |

Instances

Functor NTree Source # | NTree implements class Functor
Methods fmap :: (a -> b) -> NTree a -> NTree b # (<$) :: a -> NTree b -> NTree a #
Foldable NTree Source # | NTree implements class Foldable

Methods

fold :: Monoid m => NTree m -> m #

foldMap :: Monoid m => (a -> m) -> NTree a -> m #

foldr :: (a -> b -> b) -> b -> NTree a -> b #

foldr' :: (a -> b -> b) -> b -> NTree a -> b #

foldl :: (b -> a -> b) -> b -> NTree a -> b #

foldl' :: (b -> a -> b) -> b -> NTree a -> b #

foldr1 :: (a -> a -> a) -> NTree a -> a #

foldl1 :: (a -> a -> a) -> NTree a -> a #

toList :: NTree a -> [a] #

null :: NTree a -> Bool #

length :: NTree a -> Int #

elem :: Eq a => a -> NTree a -> Bool #

maximum :: Ord a => NTree a -> a #

minimum :: Ord a => NTree a -> a #

sum :: Num a => NTree a -> a #

product :: Num a => NTree a -> a #

Traversable NTree Source # | NTree implements class Taversable
Methods traverse :: Applicative f => (a -> f b) -> NTree a -> f (NTree b) # sequenceA :: Applicative f => NTree (f a) -> f (NTree a) # mapM :: Monad m => (a -> m b) -> NTree a -> m (NTree b) # sequence :: Monad m => NTree (m a) -> m (NTree a) #
Tree NTree Source # | Implementation of Data.Tree.Class interface for rose trees

Methods

mkTree :: a -> [NTree a] -> NTree a Source #

mkLeaf :: a -> NTree a Source #

isLeaf :: NTree a -> Bool Source #

isInner :: NTree a -> Bool Source #

getNode :: NTree a -> a Source #

getChildren :: NTree a -> [NTree a] Source #

changeNode :: (a -> a) -> NTree a -> NTree a Source #

changeChildren :: ([NTree a] -> [NTree a]) -> NTree a -> NTree a Source #

setNode :: a -> NTree a -> NTree a Source #

setChildren :: [NTree a] -> NTree a -> NTree a Source #

foldTree :: (a -> [b] -> b) -> NTree a -> b Source #

nodesTree :: NTree a -> [a] Source #

depthTree :: NTree a -> Int Source #

cardTree :: NTree a -> Int Source #

formatTree :: (a -> String) -> NTree a -> String Source #

Eq a => Eq (NTree a) Source # |
Methods (==) :: NTree a -> NTree a -> Bool # (/=) :: NTree a -> NTree a -> Bool #
Ord a => Ord (NTree a) Source # |
Methods compare :: NTree a -> NTree a -> Ordering # (<) :: NTree a -> NTree a -> Bool # (<=) :: NTree a -> NTree a -> Bool # (>) :: NTree a -> NTree a -> Bool # (>=) :: NTree a -> NTree a -> Bool # max :: NTree a -> NTree a -> NTree a # min :: NTree a -> NTree a -> NTree a #
Read a => Read (NTree a) Source # |
Methods readsPrec :: Int -> ReadS (NTree a) # readList :: ReadS [NTree a] # readPrec :: ReadPrec (NTree a) # readListPrec :: ReadPrec [NTree a] #
Show a => Show (NTree a) Source # |
Methods showsPrec :: Int -> NTree a -> ShowS # show :: NTree a -> String # showList :: [NTree a] -> ShowS #
Binary a => Binary (NTree a) Source # |
Methods put :: NTree a -> Put # get :: Get (NTree a) # putList :: [NTree a] -> Put #
NFData a => NFData (NTree a) Source # |
Methods rnf :: NTree a -> () #
WNFData a => WNFData (NTree a) Source # |
Methods rwnf :: NTree a -> () Source # rwnf2 :: NTree a -> () Source #

type NTrees a = [NTree a] Source #

shortcut for a sequence of n-ary trees