lens-3.8.7.3: Lenses, Folds and Traversals

Portability | MTPCs
Stability | provisional
Maintainer | Edward Kmett <ekmett@gmail.com>
Safe Haskell | None

Data.Tree.Lens

Description

Synopsis

- root :: Lens' (Tree a) a
- branches :: Lens' (Tree a) [Tree a]

# Documentation

root :: Lens' (Tree a) a

A `Lens` that focuses on the root of a `Tree`.

    >>> view root $ Node 42 []
    42

branches :: Lens' (Tree a) [Tree a]

A `Lens` returning the direct descendants of the root of a `Tree`

    view branches ≡ subForest