Bijection

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

Companion:
object
trait A => B
class Object
trait Matchable
class Any
Bijection[A, B]

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

@unspecialized
def andThen[A](g: B => A): A => A
Inherited from:
Function1
@unspecialized
def compose[A](g: A => A): A => B
Inherited from:
Function1
override def toString(): String
Definition Classes
Function1 -> Any
Inherited from:
Function1