package optics
- Alphabetic
- Public
- Protected
Type Members
- final case class Format[A, B](getOption: (A) => Option[B], reverseGet: (B) => A) extends Product with Serializable
A normalizing optic, isomorphic to Prism but with different laws, specifically
getOption
need not be injective; i.e., distinct inputs may have the same getOption result, which combined with a subsequentreverseGet
yield a normalized form for A.A normalizing optic, isomorphic to Prism but with different laws, specifically
getOption
need not be injective; i.e., distinct inputs may have the same getOption result, which combined with a subsequentreverseGet
yield a normalized form for A. Composition with stronger optics (Prism
andIso
) yields anotherFormat
. - final case class SplitEpi[A, B](get: (A) => B, reverseGet: (B) => A) extends Product with Serializable
A split epimorphism, which we can think of as a weaker
Iso[A, B]
whereB
is a smaller .A split epimorphism, which we can think of as a weaker
Iso[A, B]
whereB
is a smaller . type. SoreverseGet andThen get
remains an identity butget andThen reverseGet
is merely idempotent (i.e., it normalizes values inA
). The following statements hold:reverseGet
is a section ofget
,get
is a retraction ofreverseGet
,B
is a retract ofA
,- the pair
(get, reverseGet)
is a splitting of the idempotentget andThen reverseGet
.
- get
any function A => B.
- reverseGet
a section of
get
such thatreverseGet andThen get
is an identity.
- See also
Split Epimorphism at nLab
- final case class SplitMono[A, B](get: (A) => B, reverseGet: (B) => A) extends Product with Serializable
A split monomorphism, which we can think of as a weaker
Iso[A, B]
whereA
is a smaller .A split monomorphism, which we can think of as a weaker
Iso[A, B]
whereA
is a smaller . type. Soget andThen reverseGet andThen
remains an identity butreverseGet andThen get
is merely idempotent (i.e., it normalizes values inB
). The following statements hold:reverseGet
is a retraction ofget
,get
is a section ofreverseGet
,A
is a retract ofB
,- the pair
(reverseGet, get)
is a splitting of the idempotentreverseGet andThen get
.
- get
section of
reverseGet
such thatget andThen reverseGet
is an identity- reverseGet
any function B => A
- See also
Split Monomorphism at nLab
- final case class Wedge[A, B](get: (A) => B, reverseGet: (B) => A) extends Product with Serializable
Composition of a
SplitMono
and aSplitEpi
, yielding an even weaker structure where neitherget andThen reverseGet
andreverseGet andThen get
is an identity but both are idempotent.
Value Members
- object Format extends Serializable
- object Spire
- object SplitEpi extends Serializable
- object SplitMono extends Serializable
- object Wedge extends Serializable