Package fj.data.optic
Optic data types adapted from the Scala Monocle library
and inspired by the
Haskell Lens library. See the Monocle Github
page for an overview of the package.
- Version:
- %build.number%
- See Also:
- Monocle
-
Class Summary Class Description Fold<S,A> AFold
can be seen as aGetter
with many targets or a weakerPTraversal
which cannot modify its target.Getter<S,A> AGetter
can be seen as a glorified get method between a type S and a type A.Iso<S,A> PIso
when S = T and A = BLens<S,A> PLens
with a monomorphic set functionOptional<S,A> POptional
restricted to monomorphic updatePIso<S,T,A,B> APIso
defines an isomorphism between types S, A and B, T:PLens<S,T,A,B> APLens
can be seen as a pair of functions:get: S => A
i.e.POptional<S,T,A,B> PPrism<S,T,A,B> Prism<S,A> PPrism
restricted to monomorphic updatePSetter<S,T,A,B> APSetter
is a generalisation of Functor map:map: (A => B) => F[A] => F[B]
modify: (A => B) => S => T
PTraversal<S,T,A,B> APTraversal
can be seen as aPOptional
generalised to 0 to n targets where n can be infinite.Setter<S,A> PSetter
with a monomorphic modify functionTraversal<S,A>