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.type
object BigInt.type
object Boolean.type
object Byte.type
object Char.type
trait IeeeEquiv
object IeeeEquiv.type
trait StrictEquiv
object DeprecatedDoubleEquiv.type
object StrictEquiv.type
trait IeeeEquiv
object IeeeEquiv.type
trait StrictEquiv
object DeprecatedFloatEquiv.type
object StrictEquiv.type
object Int.type
object Long.type
object Short.type
object String.type
object Symbol.type
object Unit.type
trait PartialOrdering[T]
trait Ordering[T]
object ValueOrdering.type
object DeadlineIsOrdered.type
object DurationIsOrdered.type
object FiniteDurationIsOrdered.type
trait Numeric[T]
trait Fractional[T]
trait BigDecimalIsFractional
object BigDecimalIsFractional.type
trait DoubleIsFractional
object DoubleIsFractional.type
trait FloatIsFractional
object FloatIsFractional.type
trait Integral[T]
trait BigDecimalAsIfIntegral
object BigDecimalAsIfIntegral.type
trait BigIntIsIntegral
object BigIntIsIntegral.type
trait ByteIsIntegral
object ByteIsIntegral.type
trait CharIsIntegral
object CharIsIntegral.type
trait IntIsIntegral
object IntIsIntegral.type
trait LongIsIntegral
object LongIsIntegral.type
trait ShortIsIntegral
object ShortIsIntegral.type
trait BigDecimalIsConflicted
trait BigDecimalOrdering
object BigDecimal.type
trait BigIntOrdering
object BigInt.type
trait BooleanOrdering
object Boolean.type
trait ByteOrdering
object Byte.type
trait CachedReverse[T]
object Int.type
trait CharOrdering
object Char.type
trait IeeeOrdering
object IeeeOrdering.type
trait TotalOrdering
object DeprecatedDoubleOrdering.type
object TotalOrdering.type
trait IeeeOrdering
object IeeeOrdering.type
trait TotalOrdering
object DeprecatedFloatOrdering.type
object TotalOrdering.type
trait IntOrdering
trait LongOrdering
object Long.type
trait OptionOrdering[T]
trait ShortOrdering
object Short.type
trait StringOrdering
object String.type
trait SymbolOrdering
object Symbol.type
trait UnitOrdering
object Unit.type
Value members
Abstract methods
Implicitly added by Option
Returns true
iff x
is equivalent to y
.
Returns true
iff x
is equivalent to y
.
- Source:
- Equiv.scala