hxt-9.3.1.18: 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
Instance details Defined in Data.Tree.NTree.TypeDefs Methods fmap :: (a -> b) -> NTree a -> NTree b Source # (<$) :: a -> NTree b -> NTree a Source #
Foldable NTree Source # | NTree implements class Foldable

Instance details

Defined in Data.Tree.NTree.TypeDefs

Methods

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

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

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

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

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

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

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

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

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

null :: NTree a -> Bool Source #

length :: NTree a -> Int Source #

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

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

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

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

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

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

Instance details

Defined in Data.Tree.NTree.TypeDefs

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 #

NavigatableTreeModify NTZipper NTree Source # |
Instance details Defined in Data.Tree.NTree.Zipper.TypeDefs Methods addTreeLeft :: NTree a -> NTZipper a -> Maybe (NTZipper a) Source # addTreeRight :: NTree a -> NTZipper a -> Maybe (NTZipper a) Source # dropTreeLeft :: NTZipper a -> Maybe (NTZipper a) Source # dropTreeRight :: NTZipper a -> Maybe (NTZipper a) Source # substThisTree :: NTree a -> NTZipper a -> NTZipper a Source #
NavigatableTreeToTree NTZipper NTree Source # |
Instance details Defined in Data.Tree.NTree.Zipper.TypeDefs Methods fromTree :: NTree a -> NTZipper a Source # toTree :: NTZipper a -> NTree a Source #
Eq a => Eq (NTree a) Source # |
Instance details Defined in Data.Tree.NTree.TypeDefs Methods (==) :: NTree a -> NTree a -> Bool Source # (/=) :: NTree a -> NTree a -> Bool Source #
Ord a => Ord (NTree a) Source # |
Instance details Defined in Data.Tree.NTree.TypeDefs Methods compare :: NTree a -> NTree a -> Ordering Source # (<) :: NTree a -> NTree a -> Bool Source # (<=) :: NTree a -> NTree a -> Bool Source # (>) :: NTree a -> NTree a -> Bool Source # (>=) :: NTree a -> NTree a -> Bool Source # max :: NTree a -> NTree a -> NTree a Source # min :: NTree a -> NTree a -> NTree a Source #
Read a => Read (NTree a) Source # |
Instance details Defined in Data.Tree.NTree.TypeDefs Methods readsPrec :: Int -> ReadS (NTree a) Source # readList :: ReadS [NTree a] Source # readPrec :: ReadPrec (NTree a) Source # readListPrec :: ReadPrec [NTree a] Source #
Show a => Show (NTree a) Source # |
Instance details Defined in Data.Tree.NTree.TypeDefs Methods showsPrec :: Int -> NTree a -> ShowS Source # show :: NTree a -> String Source # showList :: [NTree a] -> ShowS Source #
Binary a => Binary (NTree a) Source # |
Instance details Defined in Data.Tree.NTree.TypeDefs Methods put :: NTree a -> Put Source # get :: Get (NTree a) Source # putList :: [NTree a] -> Put Source #
NFData a => NFData (NTree a) Source # |
Instance details Defined in Data.Tree.NTree.TypeDefs Methods rnf :: NTree a -> () Source #
WNFData a => WNFData (NTree a) Source # |
Instance details Defined in Data.Tree.NTree.TypeDefs Methods rwnf :: NTree a -> () Source # rwnf2 :: NTree a -> () Source #

type NTrees a = [NTree a] Source #

shortcut for a sequence of n-ary trees