lens-5.2.3: Lenses, Folds and Traversals
Copyright(C) 2012-16 Edward Kmett
LicenseBSD-style (see the file LICENSE)
MaintainerEdward Kmett <ekmett@gmail.com>
Stabilityprovisional
PortabilityMTPCs
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Tree.Lens

Description

 
Synopsis

Documentation

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.

>>> view root $ Node 42 []
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 branchessubForest