generic-tree-15329.1: Generic Tree data type




data Tree v a Source

Multary (Rose) Tree


Node a (Forest v a) 


Functor v => Functor (Tree v) 
(Functor v, Alternative v) => Applicative (Tree v) 
Foldable v => Foldable (Tree v) 
Traversable v => Traversable (Tree v) 
(Eq a, Eq (Forest v a)) => Eq (Tree v a) 

type Forest v a = v (Tree v a)Source

flatten :: Foldable v => Tree v a -> [a]Source

levels :: (Applicative v, Foldable v, Monoid (v a)) => Tree v a -> [v a]Source

Lists of nodes at each level of tree

unfoldTree :: Functor v => (b -> (a, v b)) -> b -> Tree v aSource

Build tree from seed value

unfoldTreeM :: (Monad m, Traversable v) => (b -> m (a, v b)) -> b -> m (Tree v a)Source

Build a tree from seed value, monadically