Packages

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
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Format
  2. Serializable
  3. Product
  4. Equals
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new Format(getOption: (A) => Option[B], reverseGet: (B) => A)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def andThen[C](f: Iso[B, C]): Format[A, C]

    Compose with an Iso.

  5. def andThen[C](f: Prism[B, C]): Format[A, C]

    Compose with a Prism.

  6. def andThen[C](f: Format[B, C]): Format[A, C]

    Compose with another Format.

  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
  9. def composeSplitEpi[C](f: SplitEpi[B, C]): Format[A, C]

    Compose with a SplitEpi.

  10. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  11. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  12. val getOption: (A) => Option[B]
  13. def imapA[C](f: (A) => C, g: (C) => A): Format[C, B]

    Format is an invariant functor over A.

  14. def imapB[C](f: (C) => B, g: (B) => C): Format[A, C]

    Format is an invariant functor over B.

  15. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  16. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  17. 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.

  18. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  19. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  20. def productElementNames: Iterator[String]
    Definition Classes
    Product
  21. 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)".

  22. val reverseGet: (B) => A
  23. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  24. 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)".

  25. def unsafeGet(a: A): B

    Like getOption, but throws IllegalArgumentException on failure.

  26. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  27. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  28. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped