optics-core-0.4.1.1: Optics as an abstract interface: core definitions

Safe Haskell | None
Language | Haskell2010

Data.Tree.Optics

Description

This module defines optics for manipulating `Tree`s.

Synopsis

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

# Documentation

root :: Lens' (Tree a) a Source #

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

    >>> view root $ Node 42 []
    42

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

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

    view branches ≡ subForest