planet-mitchell-0.0.0: Planet Mitchell
Tree
Contents
module Data.Tree
postorder :: Tree a -> [a] #
Flatten a Tree, returning the elements in post-order.
postorderF :: [Tree a] -> [a] #
Flatten multiple Trees in post-order.
preorder :: Tree a -> [a] #
Flatten a Tree, returning the elements in pre-order. Equivalent to flatten in Tree.
flatten
preorderF :: [Tree a] -> [a] #
Flatten multiple Trees in pre-order.
root :: Functor f => (a -> f a) -> Tree a -> f (Tree a) #
A Lens that focuses on the root of a Tree.
Lens
>>> view root $ Node 42 [] 42
>>>
view root $ Node 42 []
branches :: Functor f => ([Tree a] -> f [Tree a]) -> Tree a -> f (Tree a) #
A Lens returning the direct descendants of the root of a Tree
view branches ≡ subForest
view
branches
subForest