|
Data.Tree | Portability | portable | Stability | experimental | Maintainer | libraries@haskell.org |
|
|
|
|
|
Description |
Multi-way trees (aka rose trees) and forests.
|
|
Synopsis |
|
|
|
Documentation |
|
|
Multi-way trees, also known as rose trees.
| Constructors | Node | | rootLabel :: a | label value
| subForest :: (Forest a) | zero or more child trees
|
|
| Instances | |
|
|
|
|
Two-dimensional drawing
|
|
|
Neat 2-dimensional drawing of a tree.
|
|
|
Neat 2-dimensional drawing of a forest.
|
|
Extraction
|
|
|
The elements of a tree in pre-order.
|
|
|
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 depth-first order
|
|
|
Monadic forest builder, in depth-first order
|
|
|
Monadic tree builder, in breadth-first order,
using an algorithm adapted from
Breadth-First Numbering: Lessons from a Small Exercise in Algorithm Design,
by Chris Okasaki, ICFP'00.
|
|
|
Monadic forest builder, in breadth-first order,
using an algorithm adapted from
Breadth-First Numbering: Lessons from a Small Exercise in Algorithm Design,
by Chris Okasaki, ICFP'00.
|
|
Produced by Haddock version 0.8 |