← ZIO Prelude docs

HashOrd

zio.prelude.coherent.HashOrd
See theHashOrd companion trait
object HashOrd

Attributes

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

Members list

Value members

Concrete methods

def default[A](implicit ord: Ordering[A]): Hash[A] & Ord[A]

Constructs a Hash[A] with Ord[A] that uses the default notion of hashing embodied in the implementation of hashCode for values of type A and ordering from scala.math.Ordering.

Constructs a Hash[A] with Ord[A] that uses the default notion of hashing embodied in the implementation of hashCode for values of type A and ordering from scala.math.Ordering.

Attributes

Source
coherent.scala
def make[A](hash0: A => Int, ord: (A, A) => Ordering, equal0: (A, A) => Boolean): Hash[A] & Ord[A]

Constructs an instance from a hash0 function, an ord`` function and aequal0function. Since this takes a separateequal0`, short-circuiting the equality check (failing fast) is possible.

Constructs an instance from a hash0 function, an ord`` function and aequal0function. Since this takes a separateequal0`, short-circuiting the equality check (failing fast) is possible.

Attributes

Source
coherent.scala
def make[A](hash0: A => Int, ord: (A, A) => Ordering): Hash[A] & Ord[A]

Constructs an instance from a hash function, equal function and ord function. Checking equality is delegated to ord, so short-circuiting the equality check (failing fast) is not possible.

Constructs an instance from a hash function, equal function and ord function. Checking equality is delegated to ord, so short-circuiting the equality check (failing fast) is not possible.

Attributes

Source
coherent.scala

Implicits

Implicits

implicit def derive[A](implicit hash0: Hash[A], ord0: Ord[A]): HashOrd[A]

Attributes

Source
coherent.scala