Data.Tree.Lens
Description
root :: forall a f. Functor f => (a -> f a) -> Tree a -> f (Tree a) Source #
A Lens that focuses on the root of a Tree.
Lens
Tree
>>> view root $ Node 42 [] 42
>>>
view root $ Node 42 []
branches :: forall a f. Functor f => ([Tree a] -> f [Tree a]) -> Tree a -> f (Tree a) Source #
A Lens returning the direct descendants of the root of a Tree
view branches ≡ subForest
view
branches
subForest