The project provides Optional variants of the existing implementations of the "equal to” operator (==) for Array, Dictionary, and Set.
My question is more concerned with the overall concept as opposed to my particular implementation.
Wouldn’t this be solved automatically if collections of Equatable
could conform to Equatable themselves?
I.e. if this were valid
extension Array: Equatable where Element: Equatable
then we wouldn’t need more special cases for (combinations of)
containers of Equatable elements, like the collection types currently
are.
Yes. This is an obvious limitation of the current system that we are eager to fix. Unfortunately, it is blocked by deficiencies at several levels, most visibly (to us, at least) at the IRGen / metadata layer. Addressing those is a priority for many reasons, but specifically unblocking this feature is one of them.
John.
···
On Dec 5, 2015, at 12:39 PM, Martin Kühl via swift-dev <swift-dev@swift.org> wrote:
On 5 December 2015 at 16:38, Paul Young <paulyoungonline@gmail.com> wrote: