Add generic overloads for Equatable.== in SetAlgebra types #183
Description
It is customary for SetAlgebra
types to provide flexible overloads for isSubset
/isDisjoint
/intersection
/etc that can take more types than just Self
-- elsewhere we usually have an unconstrained generic overload that can take any Sequence
plus a handful of concrete overloads for select types for which we can do a more efficient implementation. (So e.g. OrderedSet
provides not only isSubset(of other: Self)
, but also isSubset(of other: Set<Element>)
and isSubset(of other: some Sequence<Element>)
.)
This applies to all such operations except Equatable.==
-- why can't I easily check if a Set
and an OrderedSet
contain exactly the same members?
Now we wouldn't want to add generic overloads to the ==
operator, but we can and should add a family of isEqual(to:)
methods to types conforming to SetAlgebra
that provide this flexibility.