> On Oct 18, 2017, at 12:25 PM, Thorsten Seitz via swift-evolution 
> <swift-evolution@swift.org> wrote:
> 
> Therefore having `elementsEqual` as API for unordered collections is a source 
> of bugs …

You keep saying that, and yet after repeated requests to provide evidence you 
still have not backed up this claim. How many bugs are caused by this? 
Hypotheticals are not evidence. Show us how much of a problem this is in the 
real world. Why do you think this is so important to fix? What impact is it 
going to have? If it weren’t for this thread would you even know the problem 
existed?

> Adam expressed the concern that this required `map` to implemented separately 
> for the split APIs: `Iterable.map` would have to return an `Iterable` whereas 
> `Sequence.map` would have to return a `Sequence`. 
> This is an independent issue IMO, because currently we have a similar 
> situation: `Collection.map` does not return a `Collection` either. It returns 
> an Array. This is a compromise partly due to missing language features which 
> can simply remain when `Sequence` is split.

That description does not come close to showing the magnitude of the problem 
with this approach. The reason you think it’s not a significant problem is that 
you’re only looking at a single function (map). This problem isn’t specific to 
just one function, though. The problem is that every single function that takes 
in one Sequence and returns another Sequence would have to handle this 
distinction, including functions that you and I will want to write and reuse. 
That means either:

1. Implement the function twice to handle either ordered or unordered.
2. Only handle one type.
3. Implement a complex new language feature that makes #1 slightly easier, but 
still harder than it is today.

That’s not an improvement. It’s a huge regression in usability. To make that 
kind of change should require a much stronger argument than “hypothetically 
this could lead to bugs”.
_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to