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

I have also been wondering about this approach. This protocol could also support indices that can be discovered using index(where:) and index(of:) as well as sorted and maybe even reduce where combine is commutative. If Swift gets support for HKT in the future it could also support map, compactMap and filter.

I don't think this should be called UnorderedCollection though as I think Collection (or MaterializableCollection) should refine it if it gets added. If we were starting from scratch I might consider calling this Collection but I don't think that's a viable today. The name Container was mentioned in one of the recent threads related to this topic. That's the best available option I've been able to think of.

1 Like