Bijection

smithy4s.Bijection
See theBijection companion object
trait Bijection[A, B] extends A => B

A bijection is an association of two opposite functions A => B and B => A.

A bijection MUST abide by the round-tripping property, namely, for all input A :

bijection.from(bijection(input)) == input

Attributes

Companion
object
Graph
Supertypes
trait A => B
class Object
trait Matchable
class Any
Self type
Bijection[A, B]

Members list

Value members

Abstract methods

def from(b: B): A
def to(a: A): B

Concrete methods

final def apply(a: A): B
final def imapFull[A0, B0](sourceBijection: Bijection[A, A0], targetBijection: Bijection[B, B0]): Bijection[A0, B0]
final def imapSource[A0](bijection: Bijection[A, A0]): Bijection[A0, B]
final def imapTarget[B0](bijection: Bijection[B, B0]): Bijection[A, B0]
def swap: Bijection[B, A]

Inherited methods

def andThen[A](g: B => A): T1 => A

Attributes

Inherited from:
Function1
def compose[A](g: A => A): A => R

Attributes

Inherited from:
Function1
override def toString(): String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Function1 -> Any
Inherited from:
Function1