Copyright | (C) 2016-2025 David M. Johnson |
---|---|
License | BSD3-style (see the file LICENSE) |
Maintainer | David M. Johnson <code@dmj.io> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Miso.Lens.TH
Contents
Description
TH
Re-exports
lens :: (record -> field) -> (record -> field -> record) -> Lens record field Source #
Smart constructor lens
function. Used to easily construct a Lens
name :: Lens Person String name = lens _name $ \p n -> p { _name = n }
data Lens record field Source #
A Lens
is a generalized getter and setter.
Lenses allow both the retrieval of values from fields in a record and the
assignment of values to fields in a record. The power of a Lens
comes
from its ability to be composed with other lenses.
In the context of building applications with miso, the model
is
often a deeply nested product type. This makes it highly conducive
to Lens
operations (as defined below).