Package fj.data.optic
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:
-
ClassesClassDescriptionFold<S,
A> AFoldcan be seen as aGetterwith many targets or a weakerPTraversalwhich cannot modify its target.Getter<S,A> AGettercan be seen as a glorified get method between a type S and a type A.Iso<S,A> PIsowhen S = T and A = BLens<S,A> PLenswith a monomorphic set functionOptional<S,A> POptionalrestricted to monomorphic updatePIso<S,T, A, B> APIsodefines an isomorphism between types S, A and B, T:PLens<S,T, A, B> APLenscan be seen as a pair of functions:get: S => Ai.e.POptional<S,T, A, B> PPrism<S,T, A, B> Prism<S,A> PPrismrestricted to monomorphic updatePSetter<S,T, A, B> APSetteris a generalisation of Functor map:map: (A => B) => F[A] => F[B]modify: (A => B) => S => TPTraversal<S,T, A, B> APTraversalcan be seen as aPOptionalgeneralised to 0 to n targets where n can be infinite.Setter<S,A> PSetterwith a monomorphic modify functionTraversal<S,A>