<div dir="ltr">On Fri, Oct 13, 2017 at 10:28 AM, Adam Kemp <span dir="ltr">&lt;<a href="mailto:adam.kemp@apple.com" target="_blank">adam.kemp@apple.com</a>&gt;</span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><br><br><div id="m_6957456094017928206AppleMailSignature">--<div>Adam Kemp</div></div><span class=""><div><br>On Oct 13, 2017, at 7:59 AM, Xiaodi Wu &lt;<a href="mailto:xiaodi.wu@gmail.com" target="_blank">xiaodi.wu@gmail.com</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><div>On Fri, Oct 13, 2017 at 09:02 Adam Kemp &lt;<a href="mailto:adam.kemp@apple.com" target="_blank">adam.kemp@apple.com</a>&gt; wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto">Right, but if you do look it up you get a bunch of things talking about sorting words.</div></blockquote><div dir="auto"><br></div><div dir="auto">And that’s a perfect description of the behavior. It’s a lexicographical comparison operation!</div></div></div></div></blockquote><div><br></div></span><div>Is it? Are we always comparing words?</div></div></blockquote><div><br></div><div>Let me clarify what I meant: the way in which a dictionary orders words is an excellent and widely understood analog simulacrum of lexicographical comparison. As others have already said, lexicographical comparison is an established term for comparing sequences. Not only has such usage been long established in Swift itself (`lexicographicallyPrecedes`), it is also shared with other languages (C++ has `std::lexicographical_compare`), and it originates in mathematical terminology that looked to dictionaries as inspiration for the term.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><span class=""><blockquote type="cite"><div><div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div>How about pairwiseEqual?</div></div></blockquote><div dir="auto"><br></div><div dir="auto">A lexicographical comparison compares not merely pairwise, but in order from the first item onwards, and stops at the first unequal pair. Proceeding in order is key information, while stopping early on false is a nice-to-have. There’s already a word for this, and it’s “lexicographical.” And the analogy is universally understood: everyone has used a dictionary or index.</div></div></div></div></blockquote><div><br></div></span><div>Clearly it’s not. You have several people telling you they don’t think it’s clear. You can argue that it’s technically correct if you want, but don’t try to tell us everyone understands it when it’s obvious that’s not true.</div></div></blockquote><div> </div><div>I&#39;m saying that essentially everyone here understands the process by which a dictionary arranges words; I hope we can accept this to be true without a detailed inquiry. It is not strictly the aim of this proposal to make the actual behavior of this function &quot;clear&quot; to any person who sees it, though it would be nice as a bonus; the primary aim is to alleviate the situation as it stands now where people see this function and _clearly believe it to be what it is not_. That the proposed name is obtuse is intentional--as Nate has surmised--as a way to prompt the unfamiliar user to look up the documentation. The secondary aim is to have the name be unimpeachably technically correct, and to avoid inventing new names for it; that way, once the user has looked up this term, it will be knowledge transferrable to other settings (e.g., C++), and if a user has learned about this terminology elsewhere, they will be rewarded with having that knowledge applicable to Swift.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div><div class="h5"><blockquote type="cite"><div><div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div><div><br>On Oct 13, 2017, at 5:17 AM, Xiaodi Wu &lt;<a href="mailto:xiaodi.wu@gmail.com" target="_blank">xiaodi.wu@gmail.com</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><div><div dir="auto">“Lexicographical comparison” is a pretty standard term, and easy to Google. We didn’t make it up for Swift :)</div><div dir="auto"><br></div><div dir="auto">Since Swift names this protocol Sequence, something named “Sequence.sequenceEqual” cannot distinguish this method from ==.</div><div dir="auto"><br></div><br><div class="gmail_quote"><div>On Fri, Oct 13, 2017 at 01:28 Adam Kemp &lt;<a href="mailto:adam.kemp@apple.com" target="_blank">adam.kemp@apple.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><span style="background-color:rgba(255,255,255,0)">I agree that the proposed name is a poor choice. </span>If we just focus on the naming part, there is precedent in other languages for the name “sequenceEqual”. I think that name makes it a bit clearer that the result is whether the sequences match pair wise rather than whether they have the same elements irrespective of order. I don’t think it entirely solves the problem, but I like it a lot better than the proposed name.<br><br><div id="m_6957456094017928206m_-1200901335570433091m_-1509611481453163169AppleMailSignature">--<div>Adam Kemp</div></div></div><div dir="auto"><div><br>On Oct 12, 2017, at 9:57 PM, Kevin Nattinger via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><div>–∞</div><div><br></div>1. I strongly object to the proposed name. It doesn&#39;t make it more clear to me what the method does, and is misleading at best. Among other issues, &quot;lexicographical&quot; is defined as alphabet order, and (1) this method applies to objects that are not Strings, and (2) this method&#39;s behavior isn&#39;t any more well-defined for Strings, so that name is even more of a lie than the original.<div><br><div>2. This is really just a symptom of a bigger problem. The fact that two Sets can compare equal and yet return different results for that method (among too many others) is logically inconsistent and points to a much deeper issue with Set and Sequence. It is probably about 3 releases too late to get this straightened out properly, but I&#39;ll outline the real issue in case someone has an idea for fixing it.</div><div><br></div><div><b>The root of the problem is that Set conforms to Sequence, but Sequence doesn&#39;t require a well-defined order.</b> Since Set doesn&#39;t have a well-defined order, a significant portion of its interface is unspecified. The methods are implemented because they have to be, but they doesn&#39;t have well-defined or necessarily consistent results.<br><br>A sequence is, by definition, ordered. That is reflected in the fact that over half the methods in the main Sequence definition* make no sense and are not well-defined unless there is a well-defined order to the sequence itself. What does it even mean to `dropFirst()` in a Set? The fact that two objects that compare equal can give different results for a 100% <wbr>deterministic function is illogical, nonsensical, and dangerous.</div><div><br></div><div>* 7/12 by my count, ignoring `_*` funcs but including the `var`<br><br>The current contents of Sequence can be cleanly divided into two groups; those that return SubSequence imply a specific ordering, and the rest do not.</div><div><br></div><div> I think those should be/should have been two separate protocols:</div><div><br></div><div><div style="margin:0px;line-height:normal;font-family:&#39;Andale Mono&#39;;color:rgb(233,175,205);background-color:rgba(0,0,0,0.901961)"><span style="font-variant-ligatures:no-common-ligatures">public</span><span style="font-variant-ligatures:no-common-ligatures;color:#d6d6d6"> </span><span style="font-variant-ligatures:no-common-ligatures">protocol</span><span style="font-variant-ligatures:no-common-ligatures;color:#d6d6d6"> </span><span style="font-variant-ligatures:no-common-ligatures;color:#34bbc8">Iterable</span><span style="font-variant-ligatures:no-common-ligatures;color:#d6d6d6"> {</span></div><div style="margin:0px;line-height:normal;font-family:&#39;Andale Mono&#39;;color:rgb(52,188,38);background-color:rgba(0,0,0,0.901961)"><span style="font-variant-ligatures:no-common-ligatures;color:#d6d6d6">  </span><span style="font-variant-ligatures:no-common-ligatures;color:#cd7923">associatedtype</span><span style="font-variant-ligatures:no-common-ligatures;color:#d6d6d6"> Iterator</span><span style="font-variant-ligatures:no-common-ligatures;color:#e9afcd">:</span><span style="font-variant-ligatures:no-common-ligatures;color:#d6d6d6"> </span><span style="font-variant-ligatures:no-common-ligatures">IteratorProtocol</span></div><div style="margin:0px;line-height:normal;font-family:&#39;Andale Mono&#39;;color:rgb(130,185,255);background-color:rgba(0,0,0,0.901961)"><span style="font-variant-ligatures:no-common-ligatures;color:#d6d6d6">  </span><span style="font-variant-ligatures:no-common-ligatures;color:#e9afcd">func</span><span style="font-variant-ligatures:no-common-ligatures;color:#d6d6d6"> </span><span style="font-variant-ligatures:no-common-ligatures;color:#34bbc8">map</span><span style="font-variant-ligatures:no-common-ligatures;color:#e9afcd">&lt;</span><span style="font-variant-ligatures:no-common-ligatures;color:#34bbc8">T</span><span style="font-variant-ligatures:no-common-ligatures;color:#e9afcd">&gt;</span><span style="font-variant-ligatures:no-common-ligatures;color:#d6d6d6">(</span><span style="font-variant-ligatures:no-common-ligatures;color:#34bbc8">...</span><span style="font-variant-ligatures:no-common-ligatures;color:#d6d6d6">) </span><span style="font-variant-ligatures:no-common-ligatures;color:#e9afcd">-&gt;</span><span style="font-variant-ligatures:no-common-ligatures;color:#d6d6d6"> </span><span style="font-variant-ligatures:no-common-ligatures;color:#e9afcd">[</span><span style="font-variant-ligatures:no-common-ligatures;color:#34bc26">T</span><span style="font-variant-ligatures:no-common-ligatures;color:#e9afcd">]</span><span style="font-variant-ligatures:no-common-ligatures;color:#d6d6d6"> </span><span style="font-variant-ligatures:no-common-ligatures">// Iterable where .Iterator.Element == T</span></div><div style="margin:0px;line-height:normal;font-family:&#39;Andale Mono&#39;;color:rgb(130,185,255);background-color:rgba(0,0,0,0.901961)"><span style="font-variant-ligatures:no-common-ligatures;color:#d6d6d6">  </span><span style="font-variant-ligatures:no-common-ligatures;color:#e9afcd">func</span><span style="font-variant-ligatures:no-common-ligatures;color:#d6d6d6"> </span><span style="font-variant-ligatures:no-common-ligatures;color:#34bbc8">filter</span><span style="font-variant-ligatures:no-common-ligatures;color:#d6d6d6">(</span><span style="font-variant-ligatures:no-common-ligatures;color:#34bbc8">...</span><span style="font-variant-ligatures:no-common-ligatures;color:#d6d6d6">) </span><span style="font-variant-ligatures:no-common-ligatures;color:#e9afcd">-&gt;</span><span style="font-variant-ligatures:no-common-ligatures;color:#d6d6d6"> </span><span style="font-variant-ligatures:no-common-ligatures;color:#e9afcd">[</span><span style="font-variant-ligatures:no-common-ligatures;color:#34bc26">Iterator.Element</span><span style="font-variant-ligatures:no-common-ligatures;color:#e9afcd">]</span><span style="font-variant-ligatures:no-common-ligatures;color:#d6d6d6"> </span><span style="font-variant-ligatures:no-common-ligatures">// Iterable where .Iterator.Element == Self.Iterator.Element</span></div><div style="margin:0px;line-height:normal;font-family:&#39;Andale Mono&#39;;color:rgb(52,187,200);background-color:rgba(0,0,0,0.901961)"><span style="font-variant-ligatures:no-common-ligatures;color:#d6d6d6">  </span><span style="font-variant-ligatures:no-common-ligatures;color:#e9afcd">func</span><span style="font-variant-ligatures:no-common-ligatures;color:#d6d6d6"> </span><span style="font-variant-ligatures:no-common-ligatures">forEach</span><span style="font-variant-ligatures:no-common-ligatures;color:#d6d6d6">(</span><span style="font-variant-ligatures:no-common-ligatures">...</span><span style="font-variant-ligatures:no-common-ligatures;color:#d6d6d6">)</span></div><div style="margin:0px;line-height:normal;font-family:&#39;Andale Mono&#39;;color:rgb(52,187,200);background-color:rgba(0,0,0,0.901961)"><span style="font-variant-ligatures:no-common-ligatures;color:#d6d6d6">  </span><span style="font-variant-ligatures:no-common-ligatures;color:#e9afcd">func</span><span style="font-variant-ligatures:no-common-ligatures;color:#d6d6d6"> </span><span style="font-variant-ligatures:no-common-ligatures">makeIterator</span><span style="font-variant-ligatures:no-common-ligatures;color:#d6d6d6">() </span><span style="font-variant-ligatures:no-common-ligatures;color:#e9afcd">-&gt;</span><span style="font-variant-ligatures:no-common-ligatures;color:#d6d6d6"> </span><span style="font-variant-ligatures:no-common-ligatures;color:#34bc26">Iterator</span></div><div style="margin:0px;line-height:normal;font-family:&#39;Andale Mono&#39;;color:rgb(52,187,200);background-color:rgba(0,0,0,0.901961)"><span style="font-variant-ligatures:no-common-ligatures;color:#d6d6d6">  </span><span style="font-variant-ligatures:no-common-ligatures;color:#e9afcd">var</span><span style="font-variant-ligatures:no-common-ligatures;color:#d6d6d6"> </span><span style="font-variant-ligatures:no-common-ligatures">underestimatedCount</span><span style="font-variant-ligatures:no-common-ligatures;color:#e9afcd">:</span><span style="font-variant-ligatures:no-common-ligatures;color:#d6d6d6"> </span><span style="font-variant-ligatures:no-common-ligatures;color:#34bc26">Int</span><span style="font-variant-ligatures:no-common-ligatures;color:#d6d6d6"> { </span><span style="font-variant-ligatures:no-common-ligatures;color:#cd7923">get</span><span style="font-variant-ligatures:no-common-ligatures;color:#d6d6d6"> }</span></div><div style="margin:0px;line-height:normal;font-family:&#39;Andale Mono&#39;;color:rgb(214,214,214);background-color:rgba(0,0,0,0.901961)"><span style="font-variant-ligatures:no-common-ligatures">}</span></div><div style="margin:0px;line-height:normal;font-family:&#39;Andale Mono&#39;;color:rgb(214,214,214);background-color:rgba(0,0,0,0.901961);min-height:14px"><span style="font-variant-ligatures:no-common-ligatures"></span><br></div><div style="margin:0px;line-height:normal;font-family:&#39;Andale Mono&#39;;color:rgb(130,185,255);background-color:rgba(0,0,0,0.901961)"><span style="font-variant-ligatures:no-common-ligatures;color:#e9afcd">public</span><span style="font-variant-ligatures:no-common-ligatures;color:#d6d6d6"> </span><span style="font-variant-ligatures:no-common-ligatures;color:#e9afcd">protocol</span><span style="font-variant-ligatures:no-common-ligatures;color:#d6d6d6"> </span><span style="font-variant-ligatures:no-common-ligatures;color:#34bbc8">Sequence</span><span style="font-variant-ligatures:no-common-ligatures;color:#e9afcd">:</span><span style="font-variant-ligatures:no-common-ligatures;color:#d6d6d6"> </span><span style="font-variant-ligatures:no-common-ligatures;color:#34bc26">Iterable</span><span style="font-variant-ligatures:no-common-ligatures;color:#d6d6d6"> { </span><span style="font-variant-ligatures:no-common-ligatures">// Maybe OrderedSequence just to make the well-defined-order requirement explicit</span></div><div style="margin:0px;line-height:normal;font-family:&#39;Andale Mono&#39;;color:rgb(214,214,214);background-color:rgba(0,0,0,0.901961)"><span style="font-variant-ligatures:no-common-ligatures">  </span><span style="font-variant-ligatures:no-common-ligatures;color:#cd7923">associatedtype</span><span style="font-variant-ligatures:no-common-ligatures"> SubSequence</span></div><div style="margin:0px;line-height:normal;font-family:&#39;Andale Mono&#39;;color:rgb(130,185,255);background-color:rgba(0,0,0,0.901961)"><span style="font-variant-ligatures:no-common-ligatures;color:#d6d6d6">  </span><span style="font-variant-ligatures:no-common-ligatures;color:#e9afcd">func</span><span style="font-variant-ligatures:no-common-ligatures;color:#d6d6d6"> </span><span style="font-variant-ligatures:no-common-ligatures;color:#34bbc8">dropFirst</span><span style="font-variant-ligatures:no-common-ligatures;color:#d6d6d6">(</span><span style="font-variant-ligatures:no-common-ligatures;color:#34bbc8">...</span><span style="font-variant-ligatures:no-common-ligatures;color:#d6d6d6">)   </span><span style="font-variant-ligatures:no-common-ligatures;color:#e9afcd">-&gt;</span><span style="font-variant-ligatures:no-common-ligatures;color:#d6d6d6"> </span><span style="font-variant-ligatures:no-common-ligatures;color:#34bc26">SubSequence</span><span style="font-variant-ligatures:no-common-ligatures;color:#d6d6d6">   </span><span style="font-variant-ligatures:no-common-ligatures">// Sequence where .Iterator.Element == Self.Iterator.Element</span></div><div style="margin:0px;line-height:normal;font-family:&#39;Andale Mono&#39;;color:rgb(214,214,214);background-color:rgba(0,0,0,0.901961)"><span style="font-variant-ligatures:no-common-ligatures">  </span><span style="font-variant-ligatures:no-common-ligatures;color:#e9afcd">func</span><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:#34bbc8">dropLast</span><span style="font-variant-ligatures:no-common-ligatures">(</span><span style="font-variant-ligatures:no-common-ligatures;color:#34bbc8">...</span><span style="font-variant-ligatures:no-common-ligatures">)    </span><span style="font-variant-ligatures:no-common-ligatures;color:#e9afcd">-&gt;</span><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:#34bc26">SubSequence</span><span style="font-variant-ligatures:no-common-ligatures">   </span><span style="font-variant-ligatures:no-common-ligatures;color:#82b9ff">//    &quot; &quot;</span></div><div style="margin:0px;line-height:normal;font-family:&#39;Andale Mono&#39;;color:rgb(214,214,214);background-color:rgba(0,0,0,0.901961)"><span style="font-variant-ligatures:no-common-ligatures">  </span><span style="font-variant-ligatures:no-common-ligatures;color:#e9afcd">func</span><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:#34bbc8">drop</span><span style="font-variant-ligatures:no-common-ligatures">(</span><span style="font-variant-ligatures:no-common-ligatures;color:#cd7923">while</span><span style="font-variant-ligatures:no-common-ligatures;color:#34bbc8">...</span><span style="font-variant-ligatures:no-common-ligatures">)   </span><span style="font-variant-ligatures:no-common-ligatures;color:#e9afcd">-&gt;</span><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:#34bc26">SubSequence</span><span style="font-variant-ligatures:no-common-ligatures">   </span><span style="font-variant-ligatures:no-common-ligatures;color:#82b9ff">//    &quot; &quot;</span></div><div style="margin:0px;line-height:normal;font-family:&#39;Andale Mono&#39;;color:rgb(214,214,214);background-color:rgba(0,0,0,0.901961)"><span style="font-variant-ligatures:no-common-ligatures">  </span><span style="font-variant-ligatures:no-common-ligatures;color:#e9afcd">func</span><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:#34bbc8">prefix</span><span style="font-variant-ligatures:no-common-ligatures">(</span><span style="font-variant-ligatures:no-common-ligatures;color:#34bbc8">...</span><span style="font-variant-ligatures:no-common-ligatures">)      </span><span style="font-variant-ligatures:no-common-ligatures;color:#e9afcd">-&gt;</span><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:#34bc26">SubSequence</span><span style="font-variant-ligatures:no-common-ligatures">   </span><span style="font-variant-ligatures:no-common-ligatures;color:#82b9ff">//    &quot; &quot;</span></div><div style="margin:0px;line-height:normal;font-family:&#39;Andale Mono&#39;;color:rgb(52,188,38);background-color:rgba(0,0,0,0.901961)"><span style="font-variant-ligatures:no-common-ligatures;color:#d6d6d6">  </span><span style="font-variant-ligatures:no-common-ligatures;color:#e9afcd">func</span><span style="font-variant-ligatures:no-common-ligatures;color:#d6d6d6"> </span><span style="font-variant-ligatures:no-common-ligatures;color:#34bbc8">prefix</span><span style="font-variant-ligatures:no-common-ligatures;color:#d6d6d6">(</span><span style="font-variant-ligatures:no-common-ligatures;color:#cd7923">while</span><span style="font-variant-ligatures:no-common-ligatures;color:#34bbc8">...</span><span style="font-variant-ligatures:no-common-ligatures;color:#d6d6d6">) </span><span style="font-variant-ligatures:no-common-ligatures;color:#e9afcd">-&gt;</span><span style="font-variant-ligatures:no-common-ligatures;color:#d6d6d6"> </span><span style="font-variant-ligatures:no-common-ligatures">SubSequence</span><span style="font-variant-ligatures:no-common-ligatures;color:#d6d6d6">   </span><span style="font-variant-ligatures:no-common-ligatures;color:#82b9ff">//    &quot; &quot;</span></div><div style="margin:0px;line-height:normal;font-family:&#39;Andale Mono&#39;;color:rgb(214,214,214);background-color:rgba(0,0,0,0.901961)"><span style="font-variant-ligatures:no-common-ligatures">  </span><span style="font-variant-ligatures:no-common-ligatures;color:#e9afcd">func</span><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:#34bbc8">suffix</span><span style="font-variant-ligatures:no-common-ligatures">(</span><span style="font-variant-ligatures:no-common-ligatures;color:#34bbc8">...</span><span style="font-variant-ligatures:no-common-ligatures">)      </span><span style="font-variant-ligatures:no-common-ligatures;color:#e9afcd">-&gt;</span><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:#34bc26">SubSequence</span><span style="font-variant-ligatures:no-common-ligatures">   </span><span style="font-variant-ligatures:no-common-ligatures;color:#82b9ff">//    &quot; &quot;</span></div><div style="margin:0px;line-height:normal;font-family:&#39;Andale Mono&#39;;color:rgb(130,185,255);background-color:rgba(0,0,0,0.901961)"><span style="font-variant-ligatures:no-common-ligatures;color:#d6d6d6">  </span><span style="font-variant-ligatures:no-common-ligatures;color:#e9afcd">func</span><span style="font-variant-ligatures:no-common-ligatures;color:#d6d6d6"> </span><span style="font-variant-ligatures:no-common-ligatures;color:#34bbc8">split</span><span style="font-variant-ligatures:no-common-ligatures;color:#d6d6d6">(</span><span style="color:rgb(52,187,200)">...</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(205,121,35)">where</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,187,200)">...</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(214,214,214)">)  </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(233,175,205)">-&gt;</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(214,214,214)"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(233,175,205)">[</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,188,38)">SubSequence</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(233,175,205)">]</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(214,214,214)"> </span><span style="font-variant-ligatures:no-common-ligatures">// Iterable where .Iterator.Element == (Sequence where .Iterator.Element == Self.Iterator.Element)</span></div><div style="margin:0px;line-height:normal;font-family:&#39;Andale Mono&#39;;color:rgb(214,214,214);background-color:rgba(0,0,0,0.901961)"><span style="font-variant-ligatures:no-common-ligatures">}</span></div><div><span style="font-variant-ligatures:no-common-ligatures"><br></span></div><div><span style="font-variant-ligatures:no-common-ligatures">(The comments, of course, would be more sensible types once the ideas can actually be expressed in Swift)<br><br>Then unordered collections (Set and Dictionary) would just conform to Iterable and not Sequence, so ALL the methods on those classes would make logical sense and have well-defined behavior; no change would be needed for ordered collections.<br><br>Now, the practical matter. If this were Swift 1-&gt;2 or 2-&gt;3, I doubt there would be a significant issue with actually making this change. Unfortunately, we&#39;re well beyond that and making a change this deep is an enormous deal. So I see two ways forward.<br><br>1. We could go ahead and make this separation. Although it&#39;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.<br><br>2. We could try and think of a way to make the distinction between ordered and unordered &quot;sequences&quot; in a less-breaking manner. Unfortunately, I don&#39;t have a good suggestion for this, but if anyone has ideas, I&#39;m all ears. Or eyes, as the case may be.<br><br></span></div><br></div><div><div><blockquote type="cite"><div>On Oct 12, 2017, at 4:24 PM, Xiaodi Wu via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:</div><br class="m_6957456094017928206m_-1200901335570433091m_-1509611481453163169Apple-interchange-newline"><div><div><h1>Rename <code>Sequence.elementsEqual</code></h1>
<ul><li>Proposal: <a href="https://gist.github.com/xwu/NNNN-rename-elements-equal.md" target="_blank">SE-NNNN</a></li><li>Authors: <a href="https://github.com/xwu" target="_blank">Xiaodi Wu</a></li><li>Review Manager: TBD</li><li>Status: <strong>Awaiting review</strong></li></ul><h2><a href="https://gist.github.com/xwu/1f0ef4e18a7f321f22ca65a2f56772f6#introduction" class="m_6957456094017928206m_-1200901335570433091m_-1509611481453163169gmail-anchor" id="m_6957456094017928206m_-1200901335570433091m_-1509611481453163169gmail-user-content-introduction" target="_blank"></a>Introduction</h2><p>The current behavior of <code>Sequence.elementsEqual</code> is 
potentially confusing to users given its name. Having surveyed the 
alternative solutions to this problem, it is proposed that the method be
 renamed to <code>Sequence.<wbr>lexicographicallyEquals</code>.</p><div>[...]</div></div></div></blockquote></div></div></div></div></blockquote></div><div dir="auto"><blockquote type="cite"><div><span>______________________________<wbr>_________________</span></div></blockquote></div><div dir="auto"><blockquote type="cite"><div><br><span>swift-evolution mailing list</span><br><span><a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a></span><br><span><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-<wbr>evolution</a></span><br></div></blockquote></div></blockquote></div></div>
</div></blockquote></div></div></blockquote></div></div>
</div></blockquote></div></div></div></blockquote></div><br></div></div>