<div dir="ltr">On Fri, Oct 13, 2017 at 12:12 PM, Kevin Nattinger <span dir="ltr">&lt;<a href="mailto:swift@nattinger.net" target="_blank">swift@nattinger.net</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 style="word-wrap:break-word"><br><div><span class=""><blockquote type="cite"><div>On Oct 13, 2017, at 10:01 AM, Michael Ilseman &lt;<a href="mailto:milseman@apple.com" target="_blank">milseman@apple.com</a>&gt; wrote:</div><br class="m_895452068838371365Apple-interchange-newline"><div><br class="m_895452068838371365Apple-interchange-newline"><br style="font-family:Helvetica;font-size:12px;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"><blockquote type="cite" style="font-family:Helvetica;font-size:12px;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"><div>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:</div><br class="m_895452068838371365Apple-interchange-newline"><div><div style="word-wrap:break-word"><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></div></div></blockquote><div style="font-family:Helvetica;font-size:12px;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"><br></div><div style="font-family:Helvetica;font-size:12px;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">FWIW, in the context of String, &quot;lexicographical ordering” does not imply human-written-language-<wbr>alphabetical order at all, as there’s no universal alphabetical ordering for human language. I.e., such a concrete notion for Strings does not exist, not even theoretically. “Lexicographical” derives its meaning from the mathematical usage[1] which uses that term as well as “alphabet” without being restricted to human-written-language, in which it means some total ordering over a finite set.</div><div style="font-family:Helvetica;font-size:12px;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"><br></div><div style="font-family:Helvetica;font-size:12px;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">[1] <a href="https://en.wikipedia.org/wiki/Lexicographical_order" target="_blank">https://en.wikipedia.org/<wbr>wiki/Lexicographical_order</a></div></div></blockquote><div><br></div></span>I see, apologies for the mistake. </div><div>Regardless of the specific type of ordering, lexicographicallyEquals says to me that the objects should be sorted into lexicographical order and compared. Precisely the opposite of the proposal.</div></div></blockquote><div><br></div><div>That is an interesting interpretation. I suppose anyone has the right to interpret anything in any way they please, but this seems a uniquely idiosyncratic interpretation. The total ordering is over the set of all sequences, and the comparison is between two sequences--note that the function name uses the singular (&quot;equals&quot;) and makes no reference to the lexicography or ordering of elements. Likewise, dictionaries don&#39;t sort &quot;hello&quot; and &quot;world&quot; by comparing &quot;ehllo&quot; and &quot;dlorw&quot;.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div class="h5"><div><br><blockquote type="cite"><div><br style="font-family:Helvetica;font-size:12px;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"><blockquote type="cite" style="font-family:Helvetica;font-size:12px;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"><div><div style="word-wrap:break-word"><div><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><span class="m_895452068838371365Apple-converted-space"> </span>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:rgb(214,214,214)"><span class="m_895452068838371365Apple-converted-space"> </span></span><span style="font-variant-ligatures:no-common-ligatures">protocol</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(214,214,214)"><span class="m_895452068838371365Apple-converted-space"> </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,187,200)">Iterable</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(214,214,214)"><span class="m_895452068838371365Apple-converted-space"> </span>{</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:rgb(214,214,214)"> <span class="m_895452068838371365Apple-converted-space"> </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(205,121,35)">associatedtype</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(214,214,214)"><span class="m_895452068838371365Apple-converted-space"> </span>Iterator</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 class="m_895452068838371365Apple-converted-space"> </span></span><span style="font-variant-ligatures:no-common-ligatures">Ite<wbr>ratorProtocol</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:rgb(214,214,214)"> <span class="m_895452068838371365Apple-converted-space"> </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(233,175,205)">func</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(214,214,214)"><span class="m_895452068838371365Apple-converted-space"> </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,187,200)">map</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(233,175,205)">&lt;</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,187,200)">T</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(52,187,200)">...</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(214,214,214)">)<span class="m_895452068838371365Apple-converted-space"> </span></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 class="m_895452068838371365Apple-converted-space"> </span></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)">T</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 class="m_895452068838371365Apple-converted-space"> </span></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:rgb(214,214,214)"> <span class="m_895452068838371365Apple-converted-space"> </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(233,175,205)">func</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(214,214,214)"><span class="m_895452068838371365Apple-converted-space"> </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,187,200)">filter</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(52,187,200)">...</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(214,214,214)">)<span class="m_895452068838371365Apple-converted-space"> </span></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 class="m_895452068838371365Apple-converted-space"> </span></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)">Iterato<wbr>r.Element</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 class="m_895452068838371365Apple-converted-space"> </span></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:rgb(214,214,214)"> <span class="m_895452068838371365Apple-converted-space"> </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(233,175,205)">func</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(214,214,214)"><span class="m_895452068838371365Apple-converted-space"> </span></span><span style="font-variant-ligatures:no-common-ligatures">forEach</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(214,214,214)">(</span><span style="font-variant-ligatures:no-common-ligatures">...</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(214,214,214)">)</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:rgb(214,214,214)"> <span class="m_895452068838371365Apple-converted-space"> </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(233,175,205)">func</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(214,214,214)"><span class="m_895452068838371365Apple-converted-space"> </span></span><span style="font-variant-ligatures:no-common-ligatures">makeIterator</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(214,214,214)">()<span class="m_895452068838371365Apple-converted-space"> </span></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 class="m_895452068838371365Apple-converted-space"> </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,188,38)">Itera<wbr>tor</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:rgb(214,214,214)"> <span class="m_895452068838371365Apple-converted-space"> </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(233,175,205)">var</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(214,214,214)"><span class="m_895452068838371365Apple-converted-space"> </span></span><span style="font-variant-ligatures:no-common-ligatures">underestimatedCount</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 class="m_895452068838371365Apple-converted-space"> </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,188,38)">Int</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(214,214,214)"><span class="m_895452068838371365Apple-converted-space"><wbr> </span>{<span class="m_895452068838371365Apple-converted-space"> </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(205,121,35)">get</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(214,214,214)"><span class="m_895452068838371365Apple-converted-space"> </span>}</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:rgb(233,175,205)">public</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(214,214,214)"><span class="m_895452068838371365Apple-converted-space"> </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(233,175,205)">protocol</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(214,214,214)"><span class="m_895452068838371365Apple-converted-space"> </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,187,200)">Sequence</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 class="m_895452068838371365Apple-converted-space"> </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,188,38)">Iter<wbr>able</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(214,214,214)"><span class="m_895452068838371365Apple-converted-space"> </span>{<span class="m_895452068838371365Apple-converted-space"> </span></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 class="m_895452068838371365Apple-converted-space"> </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(205,121,35)">associatedtype</span><span style="font-variant-ligatures:no-common-ligatures"><span class="m_895452068838371365Apple-converted-space"> </span>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:rgb(214,214,214)"> <span class="m_895452068838371365Apple-converted-space"> </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(233,175,205)">func</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(214,214,214)"><span class="m_895452068838371365Apple-converted-space"> </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,187,200)">dropFirst</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(52,187,200)">...</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(214,214,214)">)  <span class="m_895452068838371365Apple-converted-space"> </span></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 class="m_895452068838371365Apple-converted-space"> </span></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(214,214,214)"><span class="m_895452068838371365Apple-converted-space"> </span> <span class="m_895452068838371365Apple-converted-space"> </span></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 class="m_895452068838371365Apple-converted-space"> </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(233,175,205)">func</span><span style="font-variant-ligatures:no-common-ligatures"><span class="m_895452068838371365Apple-converted-space"> </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,187,200)">dropLast</span><span style="font-variant-ligatures:no-common-ligatures">(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,187,200)">...</span><span style="font-variant-ligatures:no-common-ligatures">)   <span class="m_895452068838371365Apple-converted-space"> </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(233,175,205)">-&gt;</span><span style="font-variant-ligatures:no-common-ligatures"><span class="m_895452068838371365Apple-converted-space"> </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,188,38)">SubSequence</span><span style="font-variant-ligatures:no-common-ligatures"><span class="m_895452068838371365Apple-converted-space"> </span> <span class="m_895452068838371365Apple-converted-space"> </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(130,185,255)">//    &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 class="m_895452068838371365Apple-converted-space"> </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(233,175,205)">func</span><span style="font-variant-ligatures:no-common-ligatures"><span class="m_895452068838371365Apple-converted-space"> </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,187,200)">drop</span><span style="font-variant-ligatures:no-common-ligatures">(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(205,121,35)">while</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,187,200)">...</span><span style="font-variant-ligatures:no-common-ligatures">)  <span class="m_895452068838371365Apple-converted-space"> </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(233,175,205)">-&gt;</span><span style="font-variant-ligatures:no-common-ligatures"><span class="m_895452068838371365Apple-converted-space"> </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,188,38)">SubSequence</span><span style="font-variant-ligatures:no-common-ligatures"><span class="m_895452068838371365Apple-converted-space"> </span> <span class="m_895452068838371365Apple-converted-space"> </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(130,185,255)">//    &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 class="m_895452068838371365Apple-converted-space"> </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(233,175,205)">func</span><span style="font-variant-ligatures:no-common-ligatures"><span class="m_895452068838371365Apple-converted-space"> </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,187,200)">prefix</span><span style="font-variant-ligatures:no-common-ligatures">(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,187,200)">...</span><span style="font-variant-ligatures:no-common-ligatures">)     <span class="m_895452068838371365Apple-converted-space"> </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(233,175,205)">-&gt;</span><span style="font-variant-ligatures:no-common-ligatures"><span class="m_895452068838371365Apple-converted-space"> </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,188,38)">SubSequence</span><span style="font-variant-ligatures:no-common-ligatures"><span class="m_895452068838371365Apple-converted-space"> </span> <span class="m_895452068838371365Apple-converted-space"> </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(130,185,255)">//    &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:rgb(214,214,214)"> <span class="m_895452068838371365Apple-converted-space"> </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(233,175,205)">func</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(214,214,214)"><span class="m_895452068838371365Apple-converted-space"> </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,187,200)">prefix</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(205,121,35)">while</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 class="m_895452068838371365Apple-converted-space"> </span></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 class="m_895452068838371365Apple-converted-space"> </span></span><span style="font-variant-ligatures:no-common-ligatures">Sub<wbr>Sequence</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(214,214,214)"><span class="m_895452068838371365Apple-converted-space"> </span> <span class="m_895452068838371365Apple-converted-space"> </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(130,185,255)">//    &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 class="m_895452068838371365Apple-converted-space"> </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(233,175,205)">func</span><span style="font-variant-ligatures:no-common-ligatures"><span class="m_895452068838371365Apple-converted-space"> </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,187,200)">suffix</span><span style="font-variant-ligatures:no-common-ligatures">(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,187,200)">...</span><span style="font-variant-ligatures:no-common-ligatures">)     <span class="m_895452068838371365Apple-converted-space"> </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(233,175,205)">-&gt;</span><span style="font-variant-ligatures:no-common-ligatures"><span class="m_895452068838371365Apple-converted-space"> </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,188,38)">SubSequence</span><span style="font-variant-ligatures:no-common-ligatures"><span class="m_895452068838371365Apple-converted-space"> </span> <span class="m_895452068838371365Apple-converted-space"> </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(130,185,255)">//    &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:rgb(214,214,214)"> <span class="m_895452068838371365Apple-converted-space"> </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(233,175,205)">func</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(214,214,214)"><span class="m_895452068838371365Apple-converted-space"> </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,187,200)">split</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(214,214,214)">(</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 class="m_895452068838371365Apple-converted-space"> </span></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 class="m_895452068838371365Apple-converted-space"> </span></span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(233,175,205)"><wbr>[</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 class="m_895452068838371365Apple-converted-space"> </span></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_895452068838371365Apple-interchange-newline"><div><div dir="ltr"><h1>Rename<span class="m_895452068838371365Apple-converted-space"> </span><code>Sequence.elementsEqual</code></h1><ul><li>Proposal:<span class="m_895452068838371365Apple-converted-space"> </span><a href="https://gist.github.com/xwu/NNNN-rename-elements-equal.md" target="_blank">SE-NNNN</a></li><li>Authors:<span class="m_895452068838371365Apple-converted-space"> </span><a href="https://github.com/xwu" target="_blank">Xiaodi Wu</a></li><li>Review Manager: TBD</li><li>Status:<span class="m_895452068838371365Apple-converted-space"> </span><strong>Awaiting review</strong></li></ul><h2><a href="https://gist.github.com/xwu/1f0ef4e18a7f321f22ca65a2f56772f6#introduction" class="m_895452068838371365gmail-anchor" id="m_895452068838371365gmail-user-content-introduction" target="_blank"></a>Introduction</h2><p>The current behavior of<span class="m_895452068838371365Apple-converted-space"> </span><code>Sequence.elementsEqual</code><span class="m_895452068838371365Apple-converted-space"> </span>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<span class="m_895452068838371365Apple-converted-space"> </span><code>Sequence.<wbr>lexicographicallyEquals</code>.</p><div>[...]</div></div></div></blockquote></div></div></div></div>______________________________<wbr>_________________<br>swift-evolution mailing list<br><a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-<wbr>evolution</a></div></blockquote></div></blockquote></div><br></div></div></div></blockquote></div><br></div></div>