<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Please re-read my earlier emails with concrete examples of problems this split would cause:<div class=""><br class=""></div><div class=""><a href="https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20171016/040501.html" class="">https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20171016/040501.html</a></div><div class=""><a href="https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20171016/040540.html" class="">https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20171016/040540.html</a></div><div class=""><br class=""></div><div class="">You’re not thinking far enough ahead about the consequences of this change. It’s not just about map, and it’s not even just about the functions that already exist today. It’s about all of the future functions that you and I and every other Swift developer is going to write dealing with Sequences. Think about the impact on those functions.</div><div class=""><br class=""></div><div class="">I’ve written many functions in C# that fit this pattern, and if C# had split IEnumerable in the same way you propose then my job would have been much harder.</div><div class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Oct 18, 2017, at 4:14 PM, Thorsten Seitz <<a href="mailto:tseitz42@icloud.com" class="">tseitz42@icloud.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 24px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class=""><br class="Apple-interchange-newline">Am 18.10.2017 um 22:04 schrieb Adam Kemp <<a href="mailto:adam_kemp@apple.com" class="">adam_kemp@apple.com</a>>:<br class=""><br class=""><br class=""><blockquote type="cite" class="">On Oct 18, 2017, at 12:25 PM, Thorsten Seitz via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:<br class=""><br class="">Therefore having `elementsEqual` as API for unordered collections is a source of bugs …<br class=""></blockquote><br class="">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?<br class=""><br class=""><blockquote type="cite" class="">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`.<span class="Apple-converted-space"> </span><br class="">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.<br class=""></blockquote><br class="">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:<br class=""><br class="">1. Implement the function twice to handle either ordered or unordered.<br class="">2. Only handle one type.<br class="">3. Implement a complex new language feature that makes #1 slightly easier, but still harder than it is today.<br class=""><br class="">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”.<br class=""></blockquote><br style="font-family: Helvetica; font-size: 24px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 24px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Is it really such a huge regression? You already have to decide whether to use `Sequence` or `Collection` or `BiDirectionalCollection` etc. Or maybe just `Array` or `Set` or `Dictionary`.</span><br style="font-family: Helvetica; font-size: 24px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 24px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 24px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Most such functions (like map, flatMap, filter) currently return `Array`. These will not be better or worse than before.</span><br style="font-family: Helvetica; font-size: 24px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 24px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 24px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">For example, `dictionary.map(f)` will result in an `Array` instead of a `Dictionary` where just the values have been replaced. You see, the problem already exists.</span><br style="font-family: Helvetica; font-size: 24px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 24px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 24px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">For functions that do not change the element type we can use existing language features like associated types as it is already done with `SubSequence`.</span><br style="font-family: Helvetica; font-size: 24px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 24px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 24px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">-Thorsten</span></div></blockquote></div><br class=""></div></body></html>