
Data.Tree  Portability  portable  Stability  experimental  Maintainer  libraries@haskell.org 





Description 
Multiway trees (aka rose trees) and forests.


Synopsis 



Documentation 


Multiway trees, also known as rose trees.
 Constructors  Node   rootLabel :: a  label value
 subForest :: Forest a  zero or more child trees


 Instances  




Twodimensional drawing



Neat 2dimensional drawing of a tree.



Neat 2dimensional drawing of a forest.


Extraction



The elements of a tree in preorder.



Lists of nodes at each level of the tree.


Building trees


unfoldTree :: (b > (a, [b])) > b > Tree a  Source 

Build a tree from a seed value



Build a forest from a list of seed values



Monadic tree builder, in depthfirst order



Monadic forest builder, in depthfirst order



Monadic tree builder, in breadthfirst order,
using an algorithm adapted from
BreadthFirst Numbering: Lessons from a Small Exercise in Algorithm Design,
by Chris Okasaki, ICFP'00.



Monadic forest builder, in breadthfirst order,
using an algorithm adapted from
BreadthFirst Numbering: Lessons from a Small Exercise in Algorithm Design,
by Chris Okasaki, ICFP'00.


Produced by Haddock version 2.6.0 