> Am 18.10.2017 um 22:36 schrieb Michael Ilseman <milse...@apple.com>:
>> To get back to the topic at hand: I propose to differentiate between 
>> unordered and ordered collections because I think that this is an important 
>> distinction with tractable impact on algorithms (as shown above). The method 
>> `elementsEqual` would be part of the ordered sequence protocol and I would 
>> suggest the name `elementsPairwiseEqual`.
>> 
> 
> You are free to propose that and justify its cost. You'll probably want to 
> plan on how you’ll present the cost/benefit analysis for the feedback of “why 
> not just slap a warning on Set/Dictionary?”

The warning will have to be slapped on `Sequence` because I and others can 
write types adopting Sequence but being unordered.

And it will have to be slapped on every public generic function written by 
anyone which takes a Sequence as argument and internally uses `elementsEqual` 
on that argument, so that the user of such an API knows that he cannot use that 
function with a Set or another unordered subtype of Sequence.

-Thorsten

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to