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 subsequent reverseGet yield a normalized form for A. Composition with stronger optics
(Prism and Iso) yields another Format.
- Source
- Format.scala
- Alphabetic
- By Inheritance
- Format
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
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](f: Iso[B, C]): Format[A, C]
Compose with an Iso.
- def andThen[C](f: Prism[B, C]): Format[A, C]
Compose with a Prism.
- def andThen[C](f: Format[B, C]): Format[A, C]
Compose with another Format.
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
- def composeSplitEpi[C](f: SplitEpi[B, C]): Format[A, C]
Compose with a SplitEpi.
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- val getOption: (A) => Option[B]
- def imapA[C](f: (A) => C, g: (C) => A): Format[C, B]
Format is an invariant functor over A.
- def imapB[C](f: (C) => B, g: (B) => C): Format[A, C]
Format is an invariant functor over B.
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def normalize(b: A): Option[A]
getOption and reverseGet, yielding a normalized formatted value.
getOption and reverseGet, yielding a normalized formatted value. Subsequent getOption/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)".
- 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)".
- def unsafeGet(a: A): B
Like getOption, but throws IllegalArgumentException on failure.
- 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])