Data.Tree.NTree.TypeDefs

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 #

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 # | NTree implements class Functor
Methods fmap :: (a -> b) -> NTree a -> NTree b # (<$) :: a -> NTree b -> NTree a #
Foldable NTree # | 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 # | 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 # | Implementation of Data.Tree.Class interface for rose trees
Methods mkTree :: a -> [NTree a] -> NTree a # mkLeaf :: a -> NTree a # isLeaf :: NTree a -> Bool # isInner :: NTree a -> Bool # getNode :: NTree a -> a # getChildren :: NTree a -> [NTree a] # changeNode :: (a -> a) -> NTree a -> NTree a # changeChildren :: ([NTree a] -> [NTree a]) -> NTree a -> NTree a # setNode :: a -> NTree a -> NTree a # setChildren :: [NTree a] -> NTree a -> NTree a # foldTree :: (a -> [b] -> b) -> NTree a -> b # nodesTree :: NTree a -> [a] # depthTree :: NTree a -> Int # cardTree :: NTree a -> Int # formatTree :: (a -> String) -> NTree a -> String #
Eq a => Eq (NTree a) # |
Methods (==) :: NTree a -> NTree a -> Bool # (/=) :: NTree a -> NTree a -> Bool #
Ord a => Ord (NTree a) # |
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) # |
Methods readsPrec :: Int -> ReadS (NTree a) # readList :: ReadS [NTree a] # readPrec :: ReadPrec (NTree a) # readListPrec :: ReadPrec [NTree a] #
Show a => Show (NTree a) # |
Methods showsPrec :: Int -> NTree a -> ShowS # show :: NTree a -> String # showList :: [NTree a] -> ShowS #
Binary a => Binary (NTree a) # |
Methods put :: NTree a -> Put # get :: Get (NTree a) # putList :: [NTree a] -> Put #
NFData a => NFData (NTree a) # |
Methods rnf :: NTree a -> () #
WNFData a => WNFData (NTree a) # |
Methods rwnf :: NTree a -> () # rwnf2 :: NTree a -> () #

type NTrees a = [NTree a] #

shortcut for a sequence of n-ary trees