package optics
- Source
- package.scala
- Alphabetic
- By Inheritance
- optics
- AnyRef
- Any
- Hide All
- Show All
- 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
getOptionneed not be injective; i.e., distinct inputs may have the same getOption result, which combined with a subsequentreverseGetyield a normalized form for A.A normalizing optic, isomorphic to Prism but with different laws, specifically
getOptionneed not be injective; i.e., distinct inputs may have the same getOption result, which combined with a subsequentreverseGetyield a normalized form for A. Composition with stronger optics (PrismandIso) 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]whereBis a smaller .A split epimorphism, which we can think of as a weaker
Iso[A, B]whereBis a smaller . type. SoreverseGet andThen getremains an identity butget andThen reverseGetis merely idempotent (i.e., it normalizes values inA). The following statements hold:reverseGetis a section ofget,getis a retraction ofreverseGet,Bis a retract ofA,- the pair
(get, reverseGet)is a splitting of the idempotentget andThen reverseGet.
- get
any function A => B.
- reverseGet
a section of
getsuch thatreverseGet andThen getis 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]whereAis a smaller .A split monomorphism, which we can think of as a weaker
Iso[A, B]whereAis a smaller . type. Soget andThen reverseGet andThenremains an identity butreverseGet andThen getis merely idempotent (i.e., it normalizes values inB). The following statements hold:reverseGetis a retraction ofget,getis a section ofreverseGet,Ais a retract ofB,- the pair
(reverseGet, get)is a splitting of the idempotentreverseGet andThen get.
- get
section of
reverseGetsuch thatget andThen reverseGetis 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
SplitMonoand aSplitEpi, yielding an even weaker structure where neitherget andThen reverseGetandreverseGet andThen getis an identity but both are idempotent.
Value Members
- def quantityIso[N, U]: Iso[Quantity[N, U], N]
Iso for coulomb quantities
- def refinedPrism[A, P](implicit v: Validate[A, P]): Prism[A, Refined[A, P]]
Prism from
AintoAwith refined predicateP. - object Format extends Serializable
- object Spire
- object SplitEpi extends Serializable
- object SplitMono extends Serializable
- object Wedge extends Serializable