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 type T.
symmetric: equiv(x, y) == equiv(y, x) for any x and y of type T.
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.
| Supertypes | |
|---|---|
| Known subtypes | 85 types |
Returns true iff x is equivalent to y.
Returns true iff x is equivalent to y.
© 2002-2022 EPFL, with contributions from Lightbend.
Licensed under the Apache License, Version 2.0.
https://scala-lang.org/api/3.2.0/scala/math/Equiv.html