Safe Haskell | None |
---|---|
Language | Haskell2010 |
A Getter
is simply a function considered as an Optic
.
Given a function f :: S -> A
, we can convert it into a
using Getter
S Ato
, and convert back to a function using view
.
This is typically useful not when you have functions/Getter
s
alone, but when you are composing multiple Optic
s to produce a
Getter
.
Formation
Introduction
Elimination
views :: Is k A_Getter => Optic' k is s a -> (a -> r) -> s -> r Source #
View the function of the value pointed to by a getter.
Computation
Well-formedness
A Getter
is not subject to any laws.
Subtyping
data A_Getter :: OpticKind Source #
Tag for a getter.