Equiv

trait Equiv[T] extends Serializable

A trait for representing equivalence relations. It is important to distinguish between a type that can be compared for equality or equivalence and a representation of equivalence on some type. This trait is for representing the latter.

An equivalence relation is a binary relation on a type. This relation is exposed as the equiv method of the Equiv trait. The relation must be:

  1. reflexive: equiv(x, x) == true for any x of type T.

  2. symmetric: equiv(x, y) == equiv(y, x) for any x and y of type T.

  3. transitive: if equiv(x, y) == true and equiv(y, z) == true, then equiv(x, z) == true for any x, y, and z of type T.

Companion
object
Source
Equiv.scala
class Any
object Unit
object Boolean
object Byte
object Char
object Short
object Int
object Long
trait IeeeEquiv
object IeeeEquiv
trait IeeeEquiv
object IeeeEquiv
object BigInt
object BigDecimal
object String
object Symbol
trait Ordering[T]
trait Numeric[T]
trait Fractional[T]
trait Integral[T]
trait CachedReverse[T]
object Int
object Unit
object Boolean
object Byte
object Char
object Short
object Long
object BigInt
object BigDecimal
object String
object Symbol

Value members

Abstract methods

def equiv(x: T, y: T): Boolean
Implicitly added by Option

Returns true iff x is equivalent to y.

def equiv(x: T, y: T): Boolean

Returns true iff x is equivalent to y.