Haskell Hierarchical Libraries (base package)ContentsIndex
Data.Tree
Portability portable
Stability experimental
Maintainer libraries@haskell.org
Description
Multi-way trees (aka rose trees) and forests.
Synopsis
data Tree a = Node a (Forest a)
type Forest a = [Tree a]
drawTree :: Show a => Tree a -> String
drawForest :: Show a => Forest a -> String
flatten :: Tree a -> [a]
levels :: Tree a -> [[a]]
Documentation
data Tree a
Multi-way trees, also known as rose trees.
Constructors
Node a (Forest a)a value and zero or more child trees.
Instances
Eq a => Eq (Tree a)
Read a => Read (Tree a)
Show a => Show (Tree a)
Functor Tree
type Forest a = [Tree a]
drawTree :: Show a => Tree a -> String
Neat 2-dimensional drawing of a tree.
drawForest :: Show a => Forest a -> String
Neat 2-dimensional drawing of a forest.
flatten :: Tree a -> [a]
The elements of a tree in pre-order.
levels :: Tree a -> [[a]]
Lists of nodes at each level of the tree.
Produced by Haddock version 0.6