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] where B is a smaller
. type. So reverseGet andThen get remains an identity but get andThen reverseGet is merely
idempotent (i.e., it normalizes values in A). 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.
- Source
- SplitEpi.scala
- See also
Split Epimorphism at nLab
- Alphabetic
- By Inheritance
- SplitEpi
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new SplitEpi(get: (A) => B, reverseGet: (B) => A)
- get
any function A => B.
- reverseGet
a section of
getsuch thatreverseGet andThen getis an identity.
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def andThen[C](bc: Prism[B, C]): Format[A, C]
Compose with a Prism to get a Format.
- def andThen[C](f: Iso[B, C]): SplitEpi[A, C]
Compose with an Iso.
- def andThen[C](f: SplitMono[B, C]): Wedge[A, C]
Compose with another SplitEpi.
- def andThen[C](f: SplitEpi[B, C]): SplitEpi[A, C]
Compose with another SplitEpi.
- def asFormat: Format[A, B]
View this SplitEpi as a Format.
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def asWedge: Wedge[A, B]
View this SplitEpi as a Wedge.
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- val get: (A) => B
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- def imapA[C](f: (C) => B, g: (B) => C): SplitEpi[A, C]
SplitEpi is an invariant functor over A.
- def imapB[C](f: (A) => C, g: (C) => A): SplitEpi[C, B]
SplitEpi is an invariant functor over B.
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def modify(f: (B) => B): (A) => A
Modify the target of the SplitEpi using a function.
- def modifyF[F[_]](f: (B) => F[B])(a: A)(implicit arg0: Functor[F]): F[A]
Modify the target of the SplitEpi using Functor.
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def normalize(a: A): A
get and reverseGet, yielding a normalized formatted value.
get and reverseGet, yielding a normalized formatted value. Subsequent get/reverseGet cycles are idempotent.
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- def productToString(b: B)(implicit as: =:=[A, String], bp: <:<[B, Product]): String
If we can reverseGet a Product as a String we can implement a tagged toString like "Foo(stuff)".
- def reverse: SplitMono[B, A]
Swapping
getandreverseGetyields aSplitMono. - val reverseGet: (B) => A
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def taggedToString(tag: String, b: B)(implicit as: =:=[A, String]): String
If we provide a tag like "Foo" and reverseGet as a String we can implement a nice toString like "Foo(stuff)".
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])