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:
reflexive:
equiv(x, x) == true
for any x of typeT
.symmetric:
equiv(x, y) == equiv(y, x)
for anyx
andy
of typeT
.transitive: if
equiv(x, y) == true
andequiv(y, z) == true
, thenequiv(x, z) == true
for anyx
,y
, andz
of typeT
.
- Companion:
- object
- Source:
- Equiv.scala
trait Serializable
class Any
object BigDecimal
object BigInt
object Boolean
object Byte
object Char
trait IeeeEquiv
object IeeeEquiv
trait StrictEquiv
object DeprecatedDoubleEquiv
object StrictEquiv
trait IeeeEquiv
object IeeeEquiv
trait StrictEquiv
object DeprecatedFloatEquiv
object StrictEquiv
object Int
object Long
object Short
object String
object Symbol
object Unit
trait PartialOrdering[T]
trait Fractional[T]
trait BigDecimalIsFractional
object BigDecimalIsFractional
trait DoubleIsFractional
object DoubleIsFractional
trait FloatIsFractional
object FloatIsFractional
trait BigDecimalAsIfIntegral
object BigDecimalAsIfIntegral
trait BigIntIsIntegral
object BigIntIsIntegral
trait ByteIsIntegral
object ByteIsIntegral
trait CharIsIntegral
object CharIsIntegral
trait IntIsIntegral
object IntIsIntegral
trait LongIsIntegral
object LongIsIntegral
trait ShortIsIntegral
object ShortIsIntegral
trait BigDecimalIsConflicted
trait BigDecimalOrdering
object BigDecimal
trait BigIntOrdering
object BigInt
trait BooleanOrdering
object Boolean
trait ByteOrdering
object Byte
trait CachedReverse[T]
object Int
trait CharOrdering
object Char
trait IeeeOrdering
object IeeeOrdering
trait TotalOrdering
object DeprecatedDoubleOrdering
object TotalOrdering
trait IeeeOrdering
object IeeeOrdering
trait TotalOrdering
object DeprecatedFloatOrdering
object TotalOrdering
trait IntOrdering
trait LongOrdering
object Long
trait OptionOrdering[T]
trait ShortOrdering
object Short
trait StringOrdering
object String
trait SymbolOrdering
object Symbol
trait UnitOrdering
object Unit