On the elementsEqual problem, or “[Pitch] Set and Dictionary should not be Sequences”

I think my suggestion from the remove Sequence thread is a possible solution here.

Basically, we need to rethink the hierarchy underlying Collection. I think I agree with removing sequence, but at the same time we also need protocols which deal with the aspects of collection of a container and collection as an ordering separately. If we do this, I think with a bit of work, we can unify a bunch of different protocols which are currently separate into a single hierarchy.

Let's think through our options carefully and make a single set of changes!

I really think we need a protocol with this concept of a container where the order of iteration doesn't matter (or isn't defined). Sequence definitely wasn't that (nor would the name imply it to be), but this protocol would be the proper place for several of the methods placed on Sequence (e.g. contains(where:), map, etc...).

1 Like