Provides an equality constraint that allows two subtypes of scala.collection.GenMap
s to be compared for equality with ===
so long
as an EqualityConstraint
is available for both key types and both value types.
Provides an equality constraint that allows two subtypes of scala.collection.GenMap
s to be compared for equality with ===
so long
as an EqualityConstraint
is available for both key types and both value types.
Provides an equality constraint that allows two subtypes of scala.collection.GenSeq
s to be compared for equality with ===
so long
as an EqualityConstraint
is available for the element types.
Provides an equality constraint that allows two subtypes of scala.collection.GenSeq
s to be compared for equality with ===
so long
as an EqualityConstraint
is available for the element types.
Provides an equality constraint that allows two subtypes of scala.collection.GenSet
s to be compared for equality with ===
so long
as an EqualityConstraint
is available for the element types.
Provides an equality constraint that allows two subtypes of scala.collection.GenSet
s to be compared for equality with ===
so long
as an EqualityConstraint
is available for the element types.
Provides three implicit methods that loosen the equality constraint defined by
TypeCheckedTripleEquals
for ScalaTraversable
s to one that more closely matches Scala's approach toTraversable
equality.Scala's approach to
Traversable
equality is that if the objects being compared are ether bothSeq
s, bothSet
s, or bothMap
s, the elements are compared to determine equality. This means you could compare an immutableVector
and a mutableListBuffer
for equality, for instance, and get true so long as the twoSeq
s contained the same elements in the same order. Here's an example:Such a comparison would not, however, compile if you used
===
underTypeCheckedTripleEquals
, becauseVector
andListBuffer
are not in a subtype/supertype relationship:If you mix or import the implicit conversion provided by
TraversableEqualityConstraint
, however, the comparison will be allowed:The equality constraints provided by this trait require that left and right sides are both subclasses of either
scala.collection.GenSeq
,scala.collection.GenSet
, orscala.collection.GenMap
, and that anCanEqual
can be found for the element types forSeq
andSet
, or the key and value types forMap
s. In the example above, both theVector
andListBuffer
are subclasses ofscala.collection.GenSeq
, and the regularTypeCheckedTripleEquals
provides equality constraints for the element types, both of which areInt
. By contrast, this trait would not allow aVector[Int]
to be compared against aListBuffer[java.util.Date]
, because no equality constraint will exist between the element typesInt
andDate
:This trait simply mixes together
SeqEqualityConstraints
,SetEqualityConstraints
, andMapEqualityConstraints
.