← ZIO Prelude docs

Equivalence

zio.prelude.Equivalence
See theEquivalence companion trait
object Equivalence

Attributes

Companion
trait
Source
Equivalence.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def apply[A, B](to0: A => B, from0: B => A): Equivalence[A, B]

Attributes

Source
Equivalence.scala
def either[A, B, C]: Equivalence[Either[A, Either[B, C]], Either[Either[A, B], C]]

Constructs an equivalence between a right-associated nested either, and a left-associated nested either.

Constructs an equivalence between a right-associated nested either, and a left-associated nested either.

Attributes

Source
Equivalence.scala
def eitherFlip[A, B]: Equivalence[Either[A, B], Either[B, A]]

Attributes

Source
Equivalence.scala
def eitherNothing[A]: Equivalence[Either[A, Nothing], A]

Attributes

Source
Equivalence.scala
def fromPartial[A, B, E1, E2](toPartial0: A => Either[E1, B], fromPartial0: B => Either[E2, A])(ev1: E1 <:< Nothing, ev2: E2 <:< Nothing): Equivalence[A, B]

Attributes

Source
Equivalence.scala
def identity[A]: Equivalence[A, A]

Constructs the identity equivalence, which just says that any type is equivalent to itself and is trivially true.

Constructs the identity equivalence, which just says that any type is equivalent to itself and is trivially true.

Attributes

Source
Equivalence.scala
def tuple[A, B, C]: Equivalence[(A, (B, C)), ((A, B), C)]

Constructs an equivalence between a right-associated nested tuple, and a left-associated nested tuple.

Constructs an equivalence between a right-associated nested tuple, and a left-associated nested tuple.

Attributes

Source
Equivalence.scala
def tupleAny[A]: Equivalence[(A, Any), A]

Attributes

Source
Equivalence.scala
def tupleFlip[A, B]: Equivalence[(A, B), (B, A)]

Attributes

Source
Equivalence.scala
def unapply[A, B](self: Equivalence[A, B]): Some[(A => B, B => A)]

Attributes

Source
Equivalence.scala