lens-3.1: Lenses, Folds and Traversals
Data.Tree.Lens
Description
Synopsis
root :: Simple Lens (Tree a) aSource
A Lens that focuses on the root of a Tree.
Lens
Tree
>>> view root $ Node 42 [] 42
>>>
view root $ Node 42 []
branches :: SimpleIndexedTraversal Int (Tree a) (Tree a)Source
A Traversal of the direct descendants of the root of a Tree indexed by its position in the list of children
Traversal
toListOf branches ≡ subForest
toListOf
branches
subForest