[swift-evolution] [Draft] Rename Sequence.elementsEqual

Kevin Nattinger swift at nattinger.net
Fri Oct 13 08:20:26 CDT 2017


> 1. We could go ahead and make this separation. Although it's a potentially large breaking change, I would argue that because the methods are ill-defined anyway, the breakage is justified and a net benefit.
> 
> 2. We could try and think of a way to make the distinction between ordered and unordered "sequences" in a less-breaking manner. Unfortunately, I don't have a good suggestion for this, but if anyone has ideas, I'm all ears. Or eyes, as the case may be.

It occurred to me, if we keep (and document) Sequence as unordered and move all the ordered methods to a new OrderedSequence, then we'd only be breaking truly broken code and we could even potentially offer a fix-it to change Sequence to OrderedSequence when we see the user using the ordered methods in places where we can see and change the generic definition. 

I think I'd still prefer Iterable/Sequence as far as naming, but this may be a more acceptable change, and I'd rather have this than no change. 




More information about the swift-evolution mailing list