← ZIO Prelude docs

CommutativeIdentity

zio.prelude.coherent.CommutativeIdentity
See theCommutativeIdentity companion object
trait CommutativeIdentity[A] extends Commutative[A], Identity[A]

Attributes

Companion
object
Source
coherent.scala
Graph
Supertypes
trait Identity[A]
trait Commutative[A]
trait Associative[A]
class Object
trait Matchable
class Any
Show all

Members list

Value members

Inherited methods

final def commute: Commutative[A]

Returns a new Commutative instance that describes the same binary operator but applied in reverse order. Since the operation is commutative this instance is guaranteed to return the same results as the original instance but one order of combination or the other may be more efficient in certain cases.

Returns a new Commutative instance that describes the same binary operator but applied in reverse order. Since the operation is commutative this instance is guaranteed to return the same results as the original instance but one order of combination or the other may be more efficient in certain cases.

Attributes

Inherited from:
Commutative
Source
Commutative.scala
final def intersperse(middle: A): Associative[A]

Attributes

Inherited from:
Associative
Source
Associative.scala
override def multiplyOption(n: Int)(a: A): Option[A]

Attributes

Definition Classes
Inherited from:
Identity
Source
Identity.scala
final def repeat(a: A)(n: Int): A

Attributes

Inherited from:
Associative
Source
Associative.scala

Inherited and Abstract methods

def combine(l: => A, r: => A): A

Attributes

Inherited from:
Associative
Source
Associative.scala
def identity: A

The identity element.

The identity element.

Attributes

Inherited from:
Identity
Source
Identity.scala