<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">As previously <strike class="">threatened</strike> mentioned, I've written a draft proposal to fix a number of naming issues with APIs operating on the beginning and end of Sequences and Collections:</div><div class=""><br class=""></div><div class="">• Inconsistent use of `prefix`/`suffix` vs. `first`/`last`</div><div class="">• Confusing naming of `drop` methods</div><div class="">• Ambiguous naming of `index(of:/where:)` and `drop(while:)`</div><div class="">• `prefix(upTo:)`, `prefix(through:)`, and `suffix(from:)` shouldn't be part of this family at all</div><div class=""><br class=""></div><div class="">To fix this, I propose:</div><div class=""><br class=""></div><div class="">• Renaming all methods which operate on more than one element at the beginning/end to use "prefix" or "suffix", not "first" or "last"</div><div class="">• Renaming `index(of:/where:)` to `earliestIndex(…)` and `first(where:)` to `earliest(where:)`</div><div class="">• Renaming the `drop` methods to use `removing`</div><div class="">• Redesigning `prefix(upTo:)`, `prefix(through:)` and `suffix(from:)` as subscripts with "partial" ranges, like `people[..<idx]` or perhaps `people[nil..<idx]`.</div><div class=""><div class=""><br class=""></div></div><div class="">Since that last point requires significant redesign, including the introduction of new types, I have also included an alternative design which uses `people[to: idx]` instead.</div><div class=""><br class=""></div><div class="">This proposal does not seek to add new functionality; it merely renames or (in the case of the "aggressive" subscript option) redesigns existing functionality. I do, however, discuss (without making many judgements about their wisdom) how these changes might affect the naming of functionality we might add in future versions of Swift.</div><div class=""><br class=""></div><div class="">I would mainly like feedback on the two most open questions left in this proposal:</div><div class=""><br class=""></div><div class="">• The choice of `removing` to replace `drop`</div><div class="">• The decision about whether to use `people[..<idx]`, `people[nil..<idx]`, or `people[to: idx]`.</div><div class=""><br class=""></div><div class="">But I'd also like comments on the rest of the proposal, and on whether I should split the prefix(upTo:/through:)/suffix(from:) changes into a separate proposal from the rest.</div><div class=""><br class=""></div><div class="">I suspect this will cause a firestorm of bikeshedding, so please try to keep your suggestions grounded. Don't just suggest a name; articulate why it's a better choice than what we already have or what this proposal suggests. Only you can prevent our first *three*-hundred-message bikeshedding thread.</div><div class=""><br class=""></div><div class="">Thanks for your attention!</div><div class=""><br class=""></div><div class="">(P.S. The proposal below includes several huge tables which may cause some mail clients to become very pouty and refuse to eat their supper. You may want to read the proposal at <<a href="https://gist.github.com/brentdax/024d26c2b68b88323989540c06261430" class="">https://gist.github.com/brentdax/024d26c2b68b88323989540c06261430</a>> instead.)</div><div class=""><br class=""></div><div class=""><div class="js-task-list-container file-box js-gist-file-update-container" style="box-sizing: border-box;"><form accept-charset="UTF-8" action="https://gist.github.com/brentdax/024d26c2b68b88323989540c06261430/file/da1ee540c3fb14666dc9a6b99ff405ee448c8a8a" class="js-comment-update" data-form-nonce="768fbafa443af714264abba4eea7aa4cf85687c1" data-remote="true" method="post" style="box-sizing: border-box;"><div id="file-sequence-end-op-md" class="file" style="box-sizing: border-box; position: relative; margin-top: 20px; margin-bottom: 15px; border: 1px solid rgb(221, 221, 221); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;"><div id="readme" class="readme blob instapaper_body" style="box-sizing: border-box;"><article class="markdown-body entry-content" itemprop="text" style="box-sizing: border-box; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 16px; line-height: 1.6; word-wrap: break-word; padding: 45px; background-color: rgb(255, 255, 255); border: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px;"><h1 style="box-sizing: border-box; font-size: 2.25em; margin-right: 0px; margin-bottom: 16px; margin-left: 0px; line-height: 1.2; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); margin-top: 0px !important;" class="">Rationalizing Sequence end-operation names</h1><ul style="box-sizing: border-box; padding-left: 2em; margin-top: 0px; margin-bottom: 16px;" class=""><li style="box-sizing: border-box;" class="">Proposal: <a href="https://gist.github.com/brentdax/NNNN-sequence-end-op.md" style="box-sizing: border-box; background-color: transparent; -webkit-text-decoration-skip: objects; color: rgb(64, 120, 192); text-decoration: none;" class="">SE-NNNN</a></li><li style="box-sizing: border-box;" class="">Author: <a href="https://github.com/brentdax" style="box-sizing: border-box; background-color: transparent; -webkit-text-decoration-skip: objects; color: rgb(64, 120, 192); text-decoration: none;" class="">Brent Royal-Gordon</a></li><li style="box-sizing: border-box;" class="">Status: <span style="box-sizing: border-box;" class="">Draft</span></li><li style="box-sizing: border-box;" class="">Review manager: TBD</li></ul><h2 style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.225; font-size: 1.75em; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238);" class=""><a id="user-content-introduction" class="anchor" href="https://gist.github.com/brentdax/024d26c2b68b88323989540c06261430#introduction" aria-hidden="true" style="box-sizing: border-box; background-color: transparent; -webkit-text-decoration-skip: objects; color: rgb(64, 120, 192); text-decoration: none; display: inline-block; padding-right: 2px; margin-left: -18px; line-height: 1;"><svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Introduction</h2><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class="">Sequence and Collection offer many special operations which access or manipulate its first or last elements, but they are plagued by inconsistent naming which can make it difficult to find inverses or remember what the standard library offers. I propose that we standardize these names so they follow consistent, predictable patterns.</p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class="">Swift-evolution thread: <a href="http://news.gmane.org/gmane.comp.lang.swift.evolution" style="box-sizing: border-box; background-color: transparent; -webkit-text-decoration-skip: objects; color: rgb(64, 120, 192); text-decoration: none;" class="">Pending</a></p><h3 style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em;" class=""><a id="user-content-scope" class="anchor" href="https://gist.github.com/brentdax/024d26c2b68b88323989540c06261430#scope" aria-hidden="true" style="box-sizing: border-box; background-color: transparent; -webkit-text-decoration-skip: objects; color: rgb(64, 120, 192); text-decoration: none; display: inline-block; padding-right: 2px; margin-left: -18px; line-height: 1.2;"><svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Scope</h3><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class=""><span style="box-sizing: border-box;" class=""><b class="">This proposal is not intended to add or remove any functionality</b></span>; it merely renames and redesigns existing operations. <span style="box-sizing: border-box;" class=""><b class="">Adding new operations is out of scope for this proposal</b></span> unless it's incidental to the new designs.</p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class="">Nonetheless, I <em style="box-sizing: border-box;" class="">do</em> want the new designs to support adding more operations in the future. The names I've chosen are informed by some of the speculative APIs discussed in "Future directions", although I think they are perfectly sensible names even if nothing else changes.</p><h2 style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.225; font-size: 1.75em; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238);" class=""><a id="user-content-motivation" class="anchor" href="https://gist.github.com/brentdax/024d26c2b68b88323989540c06261430#motivation" aria-hidden="true" style="box-sizing: border-box; background-color: transparent; -webkit-text-decoration-skip: objects; color: rgb(64, 120, 192); text-decoration: none; display: inline-block; padding-right: 2px; margin-left: -18px; line-height: 1;"><svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Motivation</h2><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class="">The <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">Sequence</code> and <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">Collection</code> protocols offer a wide variety of APIs which are defined to operate on, or from, one end of the sequence:</p><table style="box-sizing: border-box; border-spacing: 0px; border-collapse: collapse; margin-top: 0px; margin-bottom: 16px; display: block; width: 888px; overflow: auto; word-break: keep-all;" class=""><thead style="box-sizing: border-box;" class=""><tr style="box-sizing: border-box; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><th style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">Operand</th><th style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">Get</th><th style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">Index</th><th style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">Exclude</th><th style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">Remove (1)</th><th style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">Pop (1)</th><th style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">Equate (2)</th></tr></thead><tbody style="box-sizing: border-box;" class=""><tr style="box-sizing: border-box; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><span style="box-sizing: border-box;" class=""><b class="">Fixed Size</b></span></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""></td></tr><tr style="box-sizing: border-box; background-color: rgb(248, 248, 248); border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">First 1</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">C.first</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">S.dropFirst()</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">C.removeFirst()</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">C.popFirst()</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td></tr><tr style="box-sizing: border-box; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">Last 1</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">C.last</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">S.dropLast()</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">C.removeLast()</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">C.popLast()</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td></tr><tr style="box-sizing: border-box; background-color: rgb(248, 248, 248); border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">First (n: Int)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">S.prefix(_:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">S.dropFirst(_:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">C.removeFirst(_:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">S.starts(with:)</td></tr><tr style="box-sizing: border-box; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""> ...with closure</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">S.prefix(while:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">S.drop(while:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">S.starts(with:isEquivalent:)</td></tr><tr style="box-sizing: border-box; background-color: rgb(248, 248, 248); border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">Last (n: Int)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">S.suffix(_:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">S.dropLast(_:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">C.removeLast(_:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td></tr><tr style="box-sizing: border-box; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""> ...with closure</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td></tr><tr style="box-sizing: border-box; background-color: rgb(248, 248, 248); border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><span style="box-sizing: border-box;" class=""><b class="">Searching From End</b></span></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""></td></tr><tr style="box-sizing: border-box; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">First matching element</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">C.index(of:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td></tr><tr style="box-sizing: border-box; background-color: rgb(248, 248, 248); border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""> ...with closure</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">S.first(where:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">C.index(where:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td></tr><tr style="box-sizing: border-box; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">Last matching element</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td></tr><tr style="box-sizing: border-box; background-color: rgb(248, 248, 248); border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""> ...with closure</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td></tr><tr style="box-sizing: border-box; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><span style="box-sizing: border-box;" class="">Based on Index</span></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""></td></tr><tr style="box-sizing: border-box; background-color: rgb(248, 248, 248); border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">startIndex ..< (i: Index)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">C.prefix(upTo:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td></tr><tr style="box-sizing: border-box; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">startIndex ... (i: Index)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">C.prefix(through:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td></tr><tr style="box-sizing: border-box; background-color: rgb(248, 248, 248); border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">(i: Index) ..< endIndex</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">C.suffix(from:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td></tr></tbody></table><blockquote style="box-sizing: border-box; margin: 0px 0px 16px; padding: 0px 15px; color: rgb(119, 119, 119); border-left-width: 4px; border-left-style: solid; border-left-color: rgb(221, 221, 221);" class=""><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class="">I have included several blank rows for operands which fit the APIs' patterns, even if they don't happen to have any operations currently.</p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class=""><span style="box-sizing: border-box;" class="">Type abbreviations:</span></p><ul style="box-sizing: border-box; padding-left: 2em; margin-top: 0px; margin-bottom: 16px;" class=""><li style="box-sizing: border-box;" class="">S = Sequence</li><li style="box-sizing: border-box;" class="">C = Collection (or a sub-protocol like BidirectionalCollection)</li></ul><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class=""><span style="box-sizing: border-box;" class="">Notes:</span></p><ol style="box-sizing: border-box; padding-left: 2em; margin-top: 0px; margin-bottom: 0px;" class=""><li style="box-sizing: border-box;" class=""><p style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;" class=""><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">remove</code> and <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">pop</code> both mutate the array to delete the indicated element(s), but <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">remove</code> assumes as a precondition that the indicated elements exist, while <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">pop</code> checks whether or not they exist.</p></li><li style="box-sizing: border-box;" class=""><p style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;" class=""><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">String</code> and <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">NSString</code> have bespoke versions of <em style="box-sizing: border-box;" class="">first n</em> and <em style="box-sizing: border-box;" class="">last n</em> Equate operations, in the form of their <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">hasPrefix</code> and <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">hasSuffix</code> methods.</p></li></ol></blockquote><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class="">Leaving aside the question of whether any gaps in these tables ought to be filled, I see a number of issues with existing terminology.</p><h3 style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em;" class=""><a id="user-content-inconsistent-use-of-prefix-and-suffix" class="anchor" href="https://gist.github.com/brentdax/024d26c2b68b88323989540c06261430#inconsistent-use-of-prefix-and-suffix" aria-hidden="true" style="box-sizing: border-box; background-color: transparent; -webkit-text-decoration-skip: objects; color: rgb(64, 120, 192); text-decoration: none; display: inline-block; padding-right: 2px; margin-left: -18px; line-height: 1.2;"><svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Inconsistent use of <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: inherit; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">prefix</code> and <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: inherit; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">suffix</code></h3><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class="">Some APIs which operate on a variable number of elements anchored at one end or the other use the terms <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">prefix</code> or <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">suffix</code>:</p><ul style="box-sizing: border-box; padding-left: 2em; margin-top: 0px; margin-bottom: 16px;" class=""><li style="box-sizing: border-box;" class=""><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">Sequence.prefix(_:)</code> and <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">Sequence.suffix(_:)</code></li><li style="box-sizing: border-box;" class=""><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">Sequence.prefix(while:)</code></li><li style="box-sizing: border-box;" class=""><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">String.hasPrefix(_:)</code> and <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">String.hasSuffix(_:)</code></li></ul><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class="">Others, however, use <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">first</code> or <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">last</code>:</p><ul style="box-sizing: border-box; padding-left: 2em; margin-top: 0px; margin-bottom: 16px;" class=""><li style="box-sizing: border-box;" class=""><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">Sequence.dropFirst(_:)</code> and <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">Sequence.dropLast(_:)</code></li><li style="box-sizing: border-box;" class=""><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">Sequence.removeFirst(_:)</code> and <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">Sequence.removeLast(_:)</code></li></ul><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class="">Still others use neither:</p><ul style="box-sizing: border-box; padding-left: 2em; margin-top: 0px; margin-bottom: 16px;" class=""><li style="box-sizing: border-box;" class=""><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">Sequence.starts(with:)</code></li><li style="box-sizing: border-box;" class=""><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">Sequence.drop(while:)</code></li></ul><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class="">These methods are all closely related, but because of this inconsistent terminology, they fail to form predictable method families.</p><h3 style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em;" class=""><a id="user-content-first-has-multiple-meanings" class="anchor" href="https://gist.github.com/brentdax/024d26c2b68b88323989540c06261430#first-has-multiple-meanings" aria-hidden="true" style="box-sizing: border-box; background-color: transparent; -webkit-text-decoration-skip: objects; color: rgb(64, 120, 192); text-decoration: none; display: inline-block; padding-right: 2px; margin-left: -18px; line-height: 1.2;"><svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: inherit; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">first</code> has multiple meanings</h3><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class="">The word <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">first</code> can mean three different things in these APIs:</p><ul style="box-sizing: border-box; padding-left: 2em; margin-top: 0px; margin-bottom: 16px;" class=""><li style="box-sizing: border-box;" class=""><p style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;" class="">Just the very first element of the sequence.</p></li><li style="box-sizing: border-box;" class=""><p style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;" class="">A subsequence of elements anchored at the beginning of the sequence, as mentioned in the last point.</p></li><li style="box-sizing: border-box;" class=""><p style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;" class="">The first element encountered in the sequence which matches a given criterion when walking from the beginning of the sequence towards the end.</p></li></ul><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class="">It would be nice to have more clarity here.</p><h3 style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em;" class=""><a id="user-content-drop-is-misleading-and-scary" class="anchor" href="https://gist.github.com/brentdax/024d26c2b68b88323989540c06261430#drop-is-misleading-and-scary" aria-hidden="true" style="box-sizing: border-box; background-color: transparent; -webkit-text-decoration-skip: objects; color: rgb(64, 120, 192); text-decoration: none; display: inline-block; padding-right: 2px; margin-left: -18px; line-height: 1.2;"><svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: inherit; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">drop</code> is misleading and scary</h3><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class="">In a Swift context, I believe the <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">drop</code> methods are actively confusing:</p><ul style="box-sizing: border-box; padding-left: 2em; margin-top: 0px; margin-bottom: 16px;" class=""><li style="box-sizing: border-box;" class=""><p style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;" class=""><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">drop</code> does not have the -ing or -ed suffix normally used for a nonmutating method.</p></li><li style="box-sizing: border-box;" class=""><p style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;" class=""><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">drop</code> has strong associations with destructive operations; it's the term used, for instance, for deleting whole tables in SQL. Even <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">dropping</code> would probably sound more like a mutating operation than alternatives.</p></li><li style="box-sizing: border-box;" class=""><p style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;" class="">As previously mentioned, the use of <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">dropFirst</code> and <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">dropLast</code> for single-drop operations and multiple-drop operations breaks up method families.</p></li></ul><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class=""><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">drop</code>, <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">dropFirst</code>, and <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">dropLast</code> are terms of art, so we allow them a certain amount of leeway. However, I believe the <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">drop</code> functions go well beyond what we should permit. They are relatively uncommon operations, associated primarily with functional languages rather than mainstream object-oriented or imperative languages, and their violation of the normal Swift naming guidelines is especially misleading.</p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class="">The term-of-art exception is not a suicide pact; it is meant to aid understanding by importing common terminology, not bind us to follow every decision made by any language that came before us. In this case, I think we should ignore precedent and forge our own path.</p><h3 style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em;" class=""><a id="user-content-unstated-direction-of-operation" class="anchor" href="https://gist.github.com/brentdax/024d26c2b68b88323989540c06261430#unstated-direction-of-operation" aria-hidden="true" style="box-sizing: border-box; background-color: transparent; -webkit-text-decoration-skip: objects; color: rgb(64, 120, 192); text-decoration: none; display: inline-block; padding-right: 2px; margin-left: -18px; line-height: 1.2;"><svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Unstated direction of operation</h3><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class="">Several APIs could theoretically be implemented by working from either end of the sequence, and would return different results depending on the direction, but do not indicate the direction in their names:</p><ul style="box-sizing: border-box; padding-left: 2em; margin-top: 0px; margin-bottom: 16px;" class=""><li style="box-sizing: border-box;" class=""><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">Sequence.drop(while:)</code></li><li style="box-sizing: border-box;" class=""><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">Collection.index(of:)</code></li></ul><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class="">Adding a direction to these APIs would make their behavior clearer and permit us to offer opposite-end equivalents in the future. (Unmerged <a href="https://github.com/apple/swift-evolution/pull/329" style="box-sizing: border-box; background-color: transparent; -webkit-text-decoration-skip: objects; color: rgb(64, 120, 192); text-decoration: none;" class="">swift-evolution pull request 329</a> would add <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">lastIndex</code> methods.)</p><h3 style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em;" class=""><a id="user-content-the-index-base-name-has-been-polluted" class="anchor" href="https://gist.github.com/brentdax/024d26c2b68b88323989540c06261430#the-index-base-name-has-been-polluted" aria-hidden="true" style="box-sizing: border-box; background-color: transparent; -webkit-text-decoration-skip: objects; color: rgb(64, 120, 192); text-decoration: none; display: inline-block; padding-right: 2px; margin-left: -18px; line-height: 1.2;"><svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>The <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: inherit; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">index(...)</code> base name has been polluted</h3><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class="">Swift 3's new collection model placed a number of low-level index manipulating operations on the base method name <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">index</code>. These now share that name with <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">index(of:)</code> and <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">index(where:)</code>, which are much higher-level operations. This may be confusing for users looking for high-level operations; the only real relationship between the two sets of operations is that they both return an index.</p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class="">It would be nice to separate these two groups of methods into different families.</p><h3 style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em;" class=""><a id="user-content-operations-taking-an-index-are-really-slicing" class="anchor" href="https://gist.github.com/brentdax/024d26c2b68b88323989540c06261430#operations-taking-an-index-are-really-slicing" aria-hidden="true" style="box-sizing: border-box; background-color: transparent; -webkit-text-decoration-skip: objects; color: rgb(64, 120, 192); text-decoration: none; display: inline-block; padding-right: 2px; margin-left: -18px; line-height: 1.2;"><svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Operations taking an index are really slicing</h3><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class=""><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">prefix(upTo:)</code>, <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">prefix(through:)</code>, and <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">suffix(from:)</code> at first appear to belong to the same family as the other <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">prefix</code> and <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">suffix</code> methods, but deeper examination reveals otherwise. They are the only operations which take indices, and they don't cleanly extend to the other operations which belong to these families. (For instance, it would not make sense to add a <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">dropPrefix(upTo:)</code> method; it would be equivalent to <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">suffix(from:)</code>.)</p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class="">Also, on <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">Int</code>-indexed collections like <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">Array</code>, <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">prefix(_:)</code> and <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">prefix(upTo:)</code> are identical, but there is little relationship between <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">suffix(_:)</code> and <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">suffix(from:)</code>, which is confusing.</p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class=""><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">suffix(from:)</code> is a particularly severe source of confusion. The other <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">suffix</code> APIs all have parameters relative to the <em style="box-sizing: border-box;" class="">end</em>of the collection, but <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">suffix(from:)</code>'s index is still relative to the <em style="box-sizing: border-box;" class="">beginning</em> of the array. This is obvious if you think deeply about the meaning of an index, but we don't really want to force our users to stare at a strange API until they have an epiphany.</p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class="">I believe these operations have much more in common with slicing a collection using a range, and that reimagining them as slicing APIs will be more fruitful.</p><h3 style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em;" class=""><a id="user-content-why-does-it-matter" class="anchor" href="https://gist.github.com/brentdax/024d26c2b68b88323989540c06261430#why-does-it-matter" aria-hidden="true" style="box-sizing: border-box; background-color: transparent; -webkit-text-decoration-skip: objects; color: rgb(64, 120, 192); text-decoration: none; display: inline-block; padding-right: 2px; margin-left: -18px; line-height: 1.2;"><svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Why does it matter?</h3><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class="">Many of these APIs are only occasionally necessary, so it's important that they be easy to find when needed and easy to understand when read. If you know that <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">prefix(10)</code> will get the first ten elements but don't know what its inverse is, you will probably not guess that it's <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">dropFirst(10)</code>. The confusing, conflicting names in these APIs are a barrier to users adopting them where appropriate.</p><h2 style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.225; font-size: 1.75em; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238);" class=""><a id="user-content-proposed-solution" class="anchor" href="https://gist.github.com/brentdax/024d26c2b68b88323989540c06261430#proposed-solution" aria-hidden="true" style="box-sizing: border-box; background-color: transparent; -webkit-text-decoration-skip: objects; color: rgb(64, 120, 192); text-decoration: none; display: inline-block; padding-right: 2px; margin-left: -18px; line-height: 1;"><svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Proposed solution</h2><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class="">We sever the index-taking APIs from the others, forming two separate families, which I will call the "Sequence-end operations" and the "index-based operations". We then consider and redesign them along separate lines.</p><h3 style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em;" class=""><a id="user-content-sequence-end-operations" class="anchor" href="https://gist.github.com/brentdax/024d26c2b68b88323989540c06261430#sequence-end-operations" aria-hidden="true" style="box-sizing: border-box; background-color: transparent; -webkit-text-decoration-skip: objects; color: rgb(64, 120, 192); text-decoration: none; display: inline-block; padding-right: 2px; margin-left: -18px; line-height: 1.2;"><svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Sequence-end operations</h3><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class="">Each of these APIs should be renamed to use a directional word based on its row in the table:</p><table style="box-sizing: border-box; border-spacing: 0px; border-collapse: collapse; margin-top: 0px; margin-bottom: 16px; display: block; width: 888px; overflow: auto; word-break: keep-all;" class=""><thead style="box-sizing: border-box;" class=""><tr style="box-sizing: border-box; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><th style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">Operand</th><th style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">Directional word</th></tr></thead><tbody style="box-sizing: border-box;" class=""><tr style="box-sizing: border-box; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><span style="box-sizing: border-box;" class=""><b class="">Fixed Size</b></span></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""></td></tr><tr style="box-sizing: border-box; background-color: rgb(248, 248, 248); border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">First 1</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">first</td></tr><tr style="box-sizing: border-box; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">Last 1</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">last</td></tr><tr style="box-sizing: border-box; background-color: rgb(248, 248, 248); border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">First (n: Int)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">prefix</td></tr><tr style="box-sizing: border-box; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""> ...with closure</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">prefix</td></tr><tr style="box-sizing: border-box; background-color: rgb(248, 248, 248); border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">Last (n: Int)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">suffix</td></tr><tr style="box-sizing: border-box; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""> ...with closure</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">suffix</td></tr><tr style="box-sizing: border-box; background-color: rgb(248, 248, 248); border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><span style="box-sizing: border-box;" class=""><b class="">Searching From End</b></span></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""></td></tr><tr style="box-sizing: border-box; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">First matching element</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">earliest</td></tr><tr style="box-sizing: border-box; background-color: rgb(248, 248, 248); border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""> ...with closure</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">earliest</td></tr><tr style="box-sizing: border-box; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">Last matching element</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">latest</td></tr><tr style="box-sizing: border-box; background-color: rgb(248, 248, 248); border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""> ...with closure</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">latest</td></tr></tbody></table><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class="">To accomplish this, <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">starts(with:)</code> should be renamed to <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">hasPrefix(_:)</code>, and other APIs should have directional words replaced or added as appropriate.</p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class="">Additionally, the word <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">drop</code> in the "Exclude" APIs should be replaced with <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">removing</code>. These operations omit the same elements which the <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">remove</code> operations delete, so even though the types are not always the same (<code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">removing</code> returns <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">SubSequence</code>, not <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">Self</code>), I think they are similar enough to deserve to be treated as nonmutating forms.</p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class="">These changes yield (altered names <span style="box-sizing: border-box;" class=""><b class="">bold</b></span>):</p><table style="box-sizing: border-box; border-spacing: 0px; border-collapse: collapse; margin-top: 0px; margin-bottom: 16px; display: block; width: 888px; overflow: auto; word-break: keep-all;" class=""><thead style="box-sizing: border-box;" class=""><tr style="box-sizing: border-box; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><th style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">Operand</th><th style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">Get</th><th style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">Index</th><th style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">Exclude</th><th style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">Remove (1)</th><th style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">Pop (1)</th><th style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">Equate (2)</th></tr></thead><tbody style="box-sizing: border-box;" class=""><tr style="box-sizing: border-box; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><span style="box-sizing: border-box;" class=""><b class="">Fixed Size</b></span></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""></td></tr><tr style="box-sizing: border-box; background-color: rgb(248, 248, 248); border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">First 1</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">C.first</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><span style="box-sizing: border-box;" class=""><b class="">S.removingFirst()</b></span></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">C.removeFirst()</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">C.popFirst()</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td></tr><tr style="box-sizing: border-box; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">Last 1</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">C.last</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><span style="box-sizing: border-box;" class=""><b class="">S.removingLast()</b></span></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">C.removeLast()</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">C.popLast()</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td></tr><tr style="box-sizing: border-box; background-color: rgb(248, 248, 248); border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">First (n: Int)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">S.prefix(_:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><span style="box-sizing: border-box;" class=""><b class="">S.removingPrefix(_:)</b></span></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><span style="box-sizing: border-box;" class=""><b class="">C.removePrefix(_:)</b></span></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><span style="box-sizing: border-box;" class=""><b class="">S.hasPrefix(_:)</b></span></td></tr><tr style="box-sizing: border-box; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""> ...with closure</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">S.prefix(while:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><span style="box-sizing: border-box;" class=""><b class="">S.removingPrefix(while:)</b></span></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><span style="box-sizing: border-box;" class=""><b class="">S.hasPrefix(_:isEquivalent:)</b></span></td></tr><tr style="box-sizing: border-box; background-color: rgb(248, 248, 248); border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">Last (n: Int)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">S.suffix(_:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><span style="box-sizing: border-box;" class=""><b class="">S.removingSuffix(_:)</b></span></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><span style="box-sizing: border-box;" class=""><b class="">C.removeSuffix(_:)</b></span></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td></tr><tr style="box-sizing: border-box; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""> ...with closure</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td></tr><tr style="box-sizing: border-box; background-color: rgb(248, 248, 248); border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><span style="box-sizing: border-box;" class=""><b class="">Searching From End</b></span></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""></td></tr><tr style="box-sizing: border-box; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">First matching element</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><span style="box-sizing: border-box;" class=""><b class="">C.earliestIndex(of:)</b></span></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td></tr><tr style="box-sizing: border-box; background-color: rgb(248, 248, 248); border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""> ...with closure</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><span style="box-sizing: border-box;" class=""><b class="">S.earliest(where:)</b></span></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><span style="box-sizing: border-box;" class=""><b class="">C.earliestIndex(where:)</b></span></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td></tr><tr style="box-sizing: border-box; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">Last matching element</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td></tr><tr style="box-sizing: border-box; background-color: rgb(248, 248, 248); border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""> ...with closure</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td></tr></tbody></table><h4 style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.4; font-size: 1.25em;" class=""><a id="user-content-alternative-to-removing" class="anchor" href="https://gist.github.com/brentdax/024d26c2b68b88323989540c06261430#alternative-to-removing" aria-hidden="true" style="box-sizing: border-box; background-color: transparent; -webkit-text-decoration-skip: objects; color: rgb(64, 120, 192); text-decoration: none; display: inline-block; padding-right: 2px; margin-left: -18px; line-height: 1.2;"><svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Alternative to <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: inherit; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">removing</code></h4><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class="">If the type differences are seen as disqualifying <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">removing</code> as a replacement for <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">drop</code>, I suggest using <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">skipping</code> instead.</p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class="">There are, of course, <em style="box-sizing: border-box;" class="">many</em> possible alternatives to <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">skipping</code>; this is almost a perfect subject for bikeshedding. I've chosen <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">skipping</code> because:</p><ol style="box-sizing: border-box; padding-left: 2em; margin-top: 0px; margin-bottom: 16px;" class=""><li style="box-sizing: border-box;" class=""><p style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;" class="">It is not an uncommon word, unlike (say) <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">omitting</code>. This means non-native English speakers and schoolchildren are more likely to recognize it.</p></li><li style="box-sizing: border-box;" class=""><p style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;" class="">It is an -ing verb, unlike (say) <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">without</code>. This makes it fit common Swift naming patterns more closely.</p></li><li style="box-sizing: border-box;" class=""><p style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;" class="">It does not imply danger, unlike (say) <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">dropping</code>, nor some sort of ongoing process, unlike (say) <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">ignoring</code>. This makes its behavior more obvious.</p></li></ol><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class="">If you want to suggest an alternative on swift-evolution, please do not merely mention a synonym; rather, explain <em style="box-sizing: border-box;" class="">why</em> it is an improvement on either these axes or other ones. (I would be particularly interested in names other than <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">removing</code> which draw an analogy to something else in Swift.)</p><h3 style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em;" class=""><a id="user-content-index-based-operations" class="anchor" href="https://gist.github.com/brentdax/024d26c2b68b88323989540c06261430#index-based-operations" aria-hidden="true" style="box-sizing: border-box; background-color: transparent; -webkit-text-decoration-skip: objects; color: rgb(64, 120, 192); text-decoration: none; display: inline-block; padding-right: 2px; margin-left: -18px; line-height: 1.2;"><svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Index-based operations</h3><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class="">Because these APIs look up elements based on their indices, I believe these operations should be exposed as subscripts, and ideally should look like other slicing operations.</p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class="">My primary design is rather ambitious, introducing two new types and either two operator overloads, or four unary forms of existing binary operators. I therefore present a more conservative alternative as well.</p><h4 style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.4; font-size: 1.25em;" class=""><a id="user-content-preferred-ambitious-option" class="anchor" href="https://gist.github.com/brentdax/024d26c2b68b88323989540c06261430#preferred-ambitious-option" aria-hidden="true" style="box-sizing: border-box; background-color: transparent; -webkit-text-decoration-skip: objects; color: rgb(64, 120, 192); text-decoration: none; display: inline-block; padding-right: 2px; margin-left: -18px; line-height: 1.2;"><svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Preferred (ambitious) option</h4><div class="highlight highlight-source-swift" style="box-sizing: border-box; margin-bottom: 16px;"><pre style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; margin-top: 0px; margin-bottom: 0px; line-height: 1.45; word-wrap: normal; padding: 16px; overflow: auto; background-color: rgb(247, 247, 247); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-break: normal;" class=""><span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">let</span> head <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">=</span> people[<span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">..<</span>i]
<span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">let</span> tail <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">=</span> people[i<span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">..<</span>]
<span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">let</span> rearrangedPeople <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">=</span> tail <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">+</span> head</pre></div><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class="">Or this small variation:</p><div class="highlight highlight-source-swift" style="box-sizing: border-box; margin-bottom: 16px;"><pre style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; margin-top: 0px; margin-bottom: 0px; line-height: 1.45; word-wrap: normal; padding: 16px; overflow: auto; background-color: rgb(247, 247, 247); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-break: normal;" class=""><span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">let</span> head <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">=</span> people[<span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 134, 179);">nil</span> <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">..<</span> i]
<span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">let</span> tail <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">=</span> people[i <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">..<</span> <span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 134, 179);">nil</span>]
<span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">let</span> rearrangedPeople <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">=</span> tail <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">+</span> head</pre></div><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class="">The operators would construct instances of a new pair of types, <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">IncompleteRange</code> (for <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">..<</code>) and <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">IncompleteClosedRange</code> (for <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">...</code>), and <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">Collection</code> would include new subscripts taking these types. These would probably have default implementations which constructed an equivalent <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">Range</code> or <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">ClosedRange</code> using <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">startIndex</code> and <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">endIndex</code>, then passed the resulting range through to the existing subscripts.</p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class="">I prefer this option because it offers an elegant syntax immediately recognizable as a form of slicing, and provides a straightforward way for a future version of Swift to extend other <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">Range</code>-handling <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">Collection</code> operations, like <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">replaceSubrange(_:with:)</code> and <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">removeSubrange(_:)</code>, to handle subranges bound by the ends of the <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">Collection</code>.</p><h4 style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.4; font-size: 1.25em;" class=""><a id="user-content-alternative-conservative-option" class="anchor" href="https://gist.github.com/brentdax/024d26c2b68b88323989540c06261430#alternative-conservative-option" aria-hidden="true" style="box-sizing: border-box; background-color: transparent; -webkit-text-decoration-skip: objects; color: rgb(64, 120, 192); text-decoration: none; display: inline-block; padding-right: 2px; margin-left: -18px; line-height: 1.2;"><svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Alternative (conservative) option</h4><div class="highlight highlight-source-swift" style="box-sizing: border-box; margin-bottom: 16px;"><pre style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; margin-top: 0px; margin-bottom: 0px; line-height: 1.45; word-wrap: normal; padding: 16px; overflow: auto; background-color: rgb(247, 247, 247); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-break: normal;" class=""><span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">let</span> head <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">=</span> people[to: i]
<span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">let</span> tail <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">=</span> people[from: i]
<span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">let</span> rearrangedPeople <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">=</span> tail <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">+</span> head</pre></div><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class="">This would be a simple changing of the methods into subscripts; no additional types or operators would be needed. I have changed <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">upTo:</code> into just <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">to:</code> to match the pattern set by <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">stride(from:to:by:)</code>.</p><h2 style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.225; font-size: 1.75em; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238);" class=""><a id="user-content-detailed-design" class="anchor" href="https://gist.github.com/brentdax/024d26c2b68b88323989540c06261430#detailed-design" aria-hidden="true" style="box-sizing: border-box; background-color: transparent; -webkit-text-decoration-skip: objects; color: rgb(64, 120, 192); text-decoration: none; display: inline-block; padding-right: 2px; margin-left: -18px; line-height: 1;"><svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Detailed design</h2><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class=""><span style="box-sizing: border-box;" class=""><b class="">Draft note</b></span>: This section is a mere sketch and should probably be expanded before submitting for a pull request.</p><h3 style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em;" class=""><a id="user-content-sequence-end-operations-1" class="anchor" href="https://gist.github.com/brentdax/024d26c2b68b88323989540c06261430#sequence-end-operations-1" aria-hidden="true" style="box-sizing: border-box; background-color: transparent; -webkit-text-decoration-skip: objects; color: rgb(64, 120, 192); text-decoration: none; display: inline-block; padding-right: 2px; margin-left: -18px; line-height: 1.2;"><svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Sequence-end operations</h3><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class="">The following methods should be renamed as follows wherever they appear in the standard library. These are simple textual substitutions; we propose no changes whatsoever to types, parameter interpretations, or other semantics.</p><table style="box-sizing: border-box; border-spacing: 0px; border-collapse: collapse; margin-top: 0px; margin-bottom: 16px; display: block; width: 888px; overflow: auto; word-break: keep-all;" class=""><thead style="box-sizing: border-box;" class=""><tr style="box-sizing: border-box; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><th style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">Old method</th><th style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">New method</th></tr></thead><tbody style="box-sizing: border-box;" class=""><tr style="box-sizing: border-box; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">dropFirst() -> SubSequence</code></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">removingFirst() -> SubSequence</code></td></tr><tr style="box-sizing: border-box; background-color: rgb(248, 248, 248); border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">dropLast() -> SubSequence</code></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">removingLast() -> SubSequence</code></td></tr><tr style="box-sizing: border-box; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">dropFirst(_ n: Int) -> SubSequence</code></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">removingPrefix(_ n: Int) -> SubSequence</code></td></tr><tr style="box-sizing: border-box; background-color: rgb(248, 248, 248); border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">drop(@noescape while predicate: (Iterator.Element) throws -> Bool) rethrows -> SubSequence</code></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">removingPrefix(@noescape while predicate: (Iterator.Element) throws -> Bool) rethrows -> SubSequence</code></td></tr><tr style="box-sizing: border-box; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">dropLast(_ n: Int) -> SubSequence</code></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">removingSuffix(_ n: Int) -> SubSequence</code></td></tr><tr style="box-sizing: border-box; background-color: rgb(248, 248, 248); border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">removeFirst(_ n: Int)</code></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">removePrefix(_ n: Int)</code></td></tr><tr style="box-sizing: border-box; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">removeLast(_ n: Int)</code></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">removeSuffix(_ n: Int)</code></td></tr><tr style="box-sizing: border-box; background-color: rgb(248, 248, 248); border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">starts<PossiblePrefix: Sequence>(with possiblePrefix: PossiblePrefix) -> Bool where ...</code></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">hasPrefix<PossiblePrefix: Sequence>(_ possiblePrefix: PossiblePrefix) -> Bool where ...</code></td></tr><tr style="box-sizing: border-box; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">starts<PossiblePrefix : Sequence>(with possiblePrefix: PossiblePrefix, isEquivalent: @noescape (Iterator.Element, Iterator.Element) throws -> Bool) rethrows -> Bool where ...</code></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">hasPrefix<PossiblePrefix : Sequence>(_ possiblePrefix: PossiblePrefix, isEquivalent: @noescape (Iterator.Element, Iterator.Element) throws -> Bool) rethrows -> Bool where ...</code></td></tr><tr style="box-sizing: border-box; background-color: rgb(248, 248, 248); border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">first(where predicate: @noescape (Iterator.Element) throws -> Bool) rethrows -> Iterator.Element?</code></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">earliest(where predicate: @noescape (Iterator.Element) throws -> Bool) rethrows -> Iterator.Element?</code></td></tr><tr style="box-sizing: border-box; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">index(of element: Iterator.Element) -> Index?</code></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">earliestIndex(of element: Iterator.Element) -> Index?</code></td></tr><tr style="box-sizing: border-box; background-color: rgb(248, 248, 248); border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">index(where predicate: @noescape (Iterator.Element) throws -> Bool) rethrows -> Index?</code></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">earliestIndex(where predicate: @noescape (Iterator.Element) throws -> Bool) rethrows -> Index?</code></td></tr></tbody></table><h3 style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em;" class=""><a id="user-content-index-based-operations-1" class="anchor" href="https://gist.github.com/brentdax/024d26c2b68b88323989540c06261430#index-based-operations-1" aria-hidden="true" style="box-sizing: border-box; background-color: transparent; -webkit-text-decoration-skip: objects; color: rgb(64, 120, 192); text-decoration: none; display: inline-block; padding-right: 2px; margin-left: -18px; line-height: 1.2;"><svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Index-based operations</h3><h4 style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.4; font-size: 1.25em;" class=""><a id="user-content-preferred-ambitious-option-1" class="anchor" href="https://gist.github.com/brentdax/024d26c2b68b88323989540c06261430#preferred-ambitious-option-1" aria-hidden="true" style="box-sizing: border-box; background-color: transparent; -webkit-text-decoration-skip: objects; color: rgb(64, 120, 192); text-decoration: none; display: inline-block; padding-right: 2px; margin-left: -18px; line-height: 1.2;"><svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Preferred (ambitious) option</h4><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class="">Implementation would be roughly as follows:</p><ol style="box-sizing: border-box; padding-left: 2em; margin-top: 0px; margin-bottom: 16px;" class=""><li style="box-sizing: border-box;" class=""><p style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;" class="">Add a pair of new types, <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">IncompleteRange</code> and <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">IncompleteClosedRange</code>, with definitions like:</p><div class="highlight highlight-source-swift" style="box-sizing: border-box; margin-bottom: 16px;"><pre style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; margin-top: 0px; margin-bottom: 0px; line-height: 1.45; word-wrap: normal; padding: 16px; overflow: auto; background-color: rgb(247, 247, 247); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-break: normal;" class=""><span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">struct</span> IncompleteRange<span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);"><</span>Bound: <span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 134, 179);">Comparable</span><span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">></span> {
<span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">var</span> lowerBound: Bound?
<span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">var</span> upperBound: Bound?
<span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">func</span> <span class="pl-en" style="box-sizing: border-box; color: rgb(121, 93, 163);">completed</span>(<span class="pl-en" style="box-sizing: border-box; color: rgb(121, 93, 163);">with</span> <span class="pl-smi" style="box-sizing: border-box; color: rgb(51, 51, 51);">bounds</span>: <span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 134, 179);">Range</span><span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);"><</span>Bound<span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">></span>) <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">-></span> <span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 134, 179);">Range</span><Bound> {
<span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">return</span> (lowerBound <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">??</span> bounds<span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">.</span>lowerBound) <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">..<</span> (upperBound <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">??</span> bounds<span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">.</span>upperBound)
}
}
<span class="pl-c" style="box-sizing: border-box; color: rgb(150, 152, 150);">// And likewise for `IncompleteClosedRange`</span></pre></div></li><li style="box-sizing: border-box;" class=""><p style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;" class="">Either add prefix and postfix <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">..<</code> and <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">...</code> operators, or overload the existing infix <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">..<</code> and <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">...</code> operators, to construct an <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">IncompleteRange</code> or <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">IncompleteClosedRange</code>. For the prefix/postfix operators, this would look like:</p><div class="highlight highlight-source-swift" style="box-sizing: border-box; margin-bottom: 16px;"><pre style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; margin-top: 0px; margin-bottom: 0px; line-height: 1.45; word-wrap: normal; padding: 16px; overflow: auto; background-color: rgb(247, 247, 247); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-break: normal;" class=""><span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">postfix</span> <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">func</span> <span class="pl-en" style="box-sizing: border-box; color: rgb(121, 93, 163);">..<</span> <Bound: <span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 134, 179);">Comparable</span>>(lowerBound: Bound) <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">-></span> IncompleteRange<Bound> {
<span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">return</span> IncompleteRange(lowerBound: lowerBound, upperBound: <span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 134, 179);">nil</span>)
}
<span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">prefix</span> <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">func</span> <span class="pl-en" style="box-sizing: border-box; color: rgb(121, 93, 163);">..<</span> <Bound: <span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 134, 179);">Comparable</span>>(upperBound: Bound) <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">-></span> IncompleteRange<Bound> {
<span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">return</span> IncompleteRange(lowerBound: <span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 134, 179);">nil</span>, upperBound: upperBound)
}
<span class="pl-c" style="box-sizing: border-box; color: rgb(150, 152, 150);">// And likewise for `...` and `IncompleteClosedRange`</span></pre></div></li><li style="box-sizing: border-box;" class=""><p style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;" class="">Add a pair of <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">IncompleteRange</code> and <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">IncompleteClosedRange</code> subscripts to <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">Collection</code>:</p><div class="highlight highlight-source-swift" style="box-sizing: border-box; margin-bottom: 16px;"><pre style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; margin-top: 0px; margin-bottom: 0px; line-height: 1.45; word-wrap: normal; padding: 16px; overflow: auto; background-color: rgb(247, 247, 247); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-break: normal;" class=""><span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">extension</span> Collection {
<span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">subscript</span> (range: IncompleteRange<span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);"><</span>Index<span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">></span>) <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">-></span> SubSequence {
<span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">return</span> <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">self</span>[range<span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">.</span>completed(with: startIndex <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">..<</span> endIndex)]
}
<span class="pl-c" style="box-sizing: border-box; color: rgb(150, 152, 150);">// And likewise for `IncompleteClosedRange`</span>
}</pre></div></li></ol><h4 style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.4; font-size: 1.25em;" class=""><a id="user-content-alternative-conservative-option-1" class="anchor" href="https://gist.github.com/brentdax/024d26c2b68b88323989540c06261430#alternative-conservative-option-1" aria-hidden="true" style="box-sizing: border-box; background-color: transparent; -webkit-text-decoration-skip: objects; color: rgb(64, 120, 192); text-decoration: none; display: inline-block; padding-right: 2px; margin-left: -18px; line-height: 1.2;"><svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Alternative (conservative) option</h4><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class="">The three methods below will be replaced with equivalent subscripts in all types conforming to <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">Collection</code> or a sub-protocol:</p><table style="box-sizing: border-box; border-spacing: 0px; border-collapse: collapse; margin-top: 0px; margin-bottom: 16px; display: block; width: 888px; overflow: auto; word-break: keep-all;" class=""><thead style="box-sizing: border-box;" class=""><tr style="box-sizing: border-box; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><th style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">Old method</th><th style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">New subscript</th></tr></thead><tbody style="box-sizing: border-box;" class=""><tr style="box-sizing: border-box; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">prefix(upTo end: Index) -> SubSequence</code></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">subscript(to end: Index) -> SubSequence</code></td></tr><tr style="box-sizing: border-box; background-color: rgb(248, 248, 248); border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">prefix(through position: Index) -> SubSequence</code></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">subscript(through position: Index) -> SubSequence</code></td></tr><tr style="box-sizing: border-box; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">func suffix(from start: Index) -> SubSequence</code></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">subscript(from start: Index) -> SubSequence</code></td></tr></tbody></table><h2 style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.225; font-size: 1.75em; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238);" class=""><a id="user-content-impact-on-existing-code" class="anchor" href="https://gist.github.com/brentdax/024d26c2b68b88323989540c06261430#impact-on-existing-code" aria-hidden="true" style="box-sizing: border-box; background-color: transparent; -webkit-text-decoration-skip: objects; color: rgb(64, 120, 192); text-decoration: none; display: inline-block; padding-right: 2px; margin-left: -18px; line-height: 1;"><svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Impact on existing code</h2><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class="">Obviously, any code using these APIs under their old names or designs would have to be transitioned to the new names and designs.</p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class="">The sequence-end operations would be by far the simplest to handle; these are simple renamings and could be handed by <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">@available(renamed:)</code> and migration support. The only complication is that some overloads have transitioned to a new base name, while others have stayed with the old one, but I suspect the migrator is up to this task.</p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class="">The preferred option for index-based operations is more difficult to migrate. The patterns would be roughly:</p><div class="highlight highlight-source-swift" style="box-sizing: border-box; margin-bottom: 16px;"><pre style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; margin-top: 0px; margin-bottom: 0px; line-height: 1.45; word-wrap: normal; padding: 16px; overflow: auto; background-color: rgb(247, 247, 247); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-break: normal;" class="">collection<span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">.</span><span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">prefix</span>(upTo: i) <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">=></span> collection[<span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">..<</span>i] or collection[<span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 134, 179);">nil</span> <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">..<</span> i]
collection<span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">.</span><span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">prefix</span>(through: i) <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">=></span> collection[<span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">...</span>i] or collection[<span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 134, 179);">nil</span> <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">...</span> i]
collection<span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">.</span><span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 134, 179);">suffix</span>(from: i) <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">=></span> collection[i<span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">..<</span>] or collection[i <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">..<</span> <span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 134, 179);">nil</span>]</pre></div><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class="">A custom fix-it would be ideal, but is probably not absolutely necessary here; an <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">@available(message:)</code> would do in a pinch. Presumably this would have to be a special case in the migrator as well.</p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class="">The alternative option for index-based operations would be simpler to fix-it and migrate—we need merely change references from the method to the subscript with the same (or similar, for <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">upTo</code>) parameter labels. I'm not sure if <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">@available(renamed:)</code> supports changing a method to a subscript.</p><h2 style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.225; font-size: 1.75em; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238);" class=""><a id="user-content-alternatives-considered" class="anchor" href="https://gist.github.com/brentdax/024d26c2b68b88323989540c06261430#alternatives-considered" aria-hidden="true" style="box-sizing: border-box; background-color: transparent; -webkit-text-decoration-skip: objects; color: rgb(64, 120, 192); text-decoration: none; display: inline-block; padding-right: 2px; margin-left: -18px; line-height: 1;"><svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Alternatives considered</h2><ul style="box-sizing: border-box; padding-left: 2em; margin-top: 0px; margin-bottom: 16px;" class=""><li style="box-sizing: border-box;" class=""><p style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;" class="">I considered many alternatives to <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">removing</code> or <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">skipping</code>, some of which are discussed in the section about them.</p></li><li style="box-sizing: border-box;" class=""><p style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;" class="">Rather than using <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">earliest</code> and <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">latest</code>, I considered using <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">first</code> and <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">last</code> for the "First matching" and "Last matching" categories. However, I didn't like the thought of overloading a property with a function, and I felt like <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">earliest</code> and <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">latest</code> actually have different semantics (searching for the match closest to a particular end) than <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">first</code> and <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">last</code> (manipulating the element at that end).</p></li><li style="box-sizing: border-box;" class=""><p style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;" class="">I considered using <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">first</code> and <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">last</code> as the basis for both single-element and multiple-element operations (such that <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">prefix(3)</code> would become <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">first(3)</code>, etc.), but:</p><ol style="box-sizing: border-box; padding-left: 2em; margin-top: 0px; margin-bottom: 0px; list-style-type: lower-roman;" class=""><li style="box-sizing: border-box;" class=""><p style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;" class="">These seemed like distinct functionalities, particularly since their types are different.</p></li><li style="box-sizing: border-box;" class=""><p style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;" class="">I'm not comfortable with heavily overloading a property with a bunch of methods, and didn't want to make <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">first</code>and <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">last</code> into methods.</p></li><li style="box-sizing: border-box;" class=""><p style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;" class="">Most APIs work fine, but <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">hasFirst(_:)</code> is atrocious, and I see no better alternative which includes the word <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">first</code>.</p></li></ol></li><li style="box-sizing: border-box;" class=""><p style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;" class="">I considered moving <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">first</code> and <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">last</code> to <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">Sequence</code> and possibly making them methods, but my understanding is that the core team has considered and rejected this approach in the past.</p></li><li style="box-sizing: border-box;" class=""><p style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;" class="">I considered moving <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">removingFirst</code> and <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">removingLast</code> to Collection and making them properties, to match <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">first</code>and <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">last</code>, but this seemed like the sort of foolish consistency that Ralph Waldo Emerson warned of.</p></li></ul><h2 style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.225; font-size: 1.75em; padding-bottom: 0.3em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238);" class=""><a id="user-content-future-directions" class="anchor" href="https://gist.github.com/brentdax/024d26c2b68b88323989540c06261430#future-directions" aria-hidden="true" style="box-sizing: border-box; background-color: transparent; -webkit-text-decoration-skip: objects; color: rgb(64, 120, 192); text-decoration: none; display: inline-block; padding-right: 2px; margin-left: -18px; line-height: 1;"><svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Future directions</h2><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class=""><span style="box-sizing: border-box;" class=""><b class="">Note</b></span>: The rest of this proposal is <em style="box-sizing: border-box;" class="">highly</em> speculative and there's probably no need to read further.</p><h3 style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em;" class=""><a id="user-content-other-sequence-api-cleanups" class="anchor" href="https://gist.github.com/brentdax/024d26c2b68b88323989540c06261430#other-sequence-api-cleanups" aria-hidden="true" style="box-sizing: border-box; background-color: transparent; -webkit-text-decoration-skip: objects; color: rgb(64, 120, 192); text-decoration: none; display: inline-block; padding-right: 2px; margin-left: -18px; line-height: 1.2;"><svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Other Sequence API cleanups</h3><h4 style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.4; font-size: 1.25em;" class=""><a id="user-content-seriously-source-breaking" class="anchor" href="https://gist.github.com/brentdax/024d26c2b68b88323989540c06261430#seriously-source-breaking" aria-hidden="true" style="box-sizing: border-box; background-color: transparent; -webkit-text-decoration-skip: objects; color: rgb(64, 120, 192); text-decoration: none; display: inline-block; padding-right: 2px; margin-left: -18px; line-height: 1.2;"><svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Seriously source-breaking</h4><ul style="box-sizing: border-box; padding-left: 2em; margin-top: 0px; margin-bottom: 16px;" class=""><li style="box-sizing: border-box;" class=""><p style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;" class="">There is an ongoing discussion about which, if any, of <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">map</code>, <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">flatMap</code>, <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">filter</code>, and <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">reduce</code> ought to be renamed to more closely match Swift naming conventions. There is also discussion about relabeling many closure parameters.</p><p style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;" class="">The "Future directions" section below suggests <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">every(where:)</code> as an alternative to <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">filter</code> which could be extended in ways compatible with this proposal.</p></li></ul><h4 style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.4; font-size: 1.25em;" class=""><a id="user-content-significantly-source-breaking" class="anchor" href="https://gist.github.com/brentdax/024d26c2b68b88323989540c06261430#significantly-source-breaking" aria-hidden="true" style="box-sizing: border-box; background-color: transparent; -webkit-text-decoration-skip: objects; color: rgb(64, 120, 192); text-decoration: none; display: inline-block; padding-right: 2px; margin-left: -18px; line-height: 1.2;"><svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Significantly source-breaking</h4><ul style="box-sizing: border-box; padding-left: 2em; margin-top: 0px; margin-bottom: 16px;" class=""><li style="box-sizing: border-box;" class=""><p style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;" class="">The <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">removeSubrange(_:)</code> and <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">replaceSubrange(_:with:)</code> APIs are rather oddly named. They might be better renamed to, for instance, <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">remove(in:)</code> and <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">replace(in:with:)</code>.</p></li><li style="box-sizing: border-box;" class=""><p style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;" class="">It is not clear how important <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">removingFirst()</code> and <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">removingLast()</code> actually are, given that they're exactly equivalent to <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">removingPrefix(1)</code> and <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">removingSuffix(1)</code>, and their corresponding "get" members are on <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">Collection</code> instead of <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">Sequence</code>. They could be removed.</p></li></ul><h4 style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.4; font-size: 1.25em;" class=""><a id="user-content-slightly-source-breaking" class="anchor" href="https://gist.github.com/brentdax/024d26c2b68b88323989540c06261430#slightly-source-breaking" aria-hidden="true" style="box-sizing: border-box; background-color: transparent; -webkit-text-decoration-skip: objects; color: rgb(64, 120, 192); text-decoration: none; display: inline-block; padding-right: 2px; margin-left: -18px; line-height: 1.2;"><svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Slightly source-breaking</h4><ul style="box-sizing: border-box; padding-left: 2em; margin-top: 0px; margin-bottom: 16px;" class=""><li style="box-sizing: border-box;" class=""><p style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;" class=""><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">removeFirst/Last()</code> and <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">popFirst/Last()</code> are very nearly redundant; their only difference is that the <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">remove</code>methods have a non-<code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">Optional</code> return type and require the collection not be empty, while the <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">pop</code> methods have an <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">Optional</code> return type and return <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">nil</code> if it's empty.</p><p style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;" class="">These operations could be merged, with the <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">remove</code> operations taking on the preconditions of the current <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">pop</code>operations; additionally, <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">removePrefix(_:)</code> and <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">removeSuffix(_:)</code> could drop their equivalent preconditions requiring that the elements being removed exist. These changes would simplify the standard library and make these methods more closely parallel the equivalent <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">removing</code> methods, which do not have similar preconditions.</p><p style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;" class="">Performance-critical code which wants to avoid the checks necessary to remove these preconditions could switch to <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">remove(at:)</code> and <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">removeSubrange(_:)</code>, which would continue to reject invalid indices.</p></li></ul><h3 style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.43; font-size: 1.5em;" class=""><a id="user-content-adding-sequence-and-collection-operations" class="anchor" href="https://gist.github.com/brentdax/024d26c2b68b88323989540c06261430#adding-sequence-and-collection-operations" aria-hidden="true" style="box-sizing: border-box; background-color: transparent; -webkit-text-decoration-skip: objects; color: rgb(64, 120, 192); text-decoration: none; display: inline-block; padding-right: 2px; margin-left: -18px; line-height: 1.2;"><svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Adding sequence and collection operations</h3><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class="">This exercise in renaming suggests all sorts of other APIs we might add, and a few we might rename.</p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class="">In general, I have not attempted to carefully scrutinize the usefulness of each of these APIs; instead, I have merely listed the ones which I can imagine some kind of use for. The main exception is the "Pop" operation; I can imagine several different, and rather incompatible, ways to extend it, and I'm not going to take the time to sort out my thoughts merely to write a "Future directions" section.</p><h4 style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.4; font-size: 1.25em;" class=""><a id="user-content-filling-in-the-sequence-end-api-table" class="anchor" href="https://gist.github.com/brentdax/024d26c2b68b88323989540c06261430#filling-in-the-sequence-end-api-table" aria-hidden="true" style="box-sizing: border-box; background-color: transparent; -webkit-text-decoration-skip: objects; color: rgb(64, 120, 192); text-decoration: none; display: inline-block; padding-right: 2px; margin-left: -18px; line-height: 1.2;"><svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Filling in the sequence-end API table</h4><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class="">The gaps in the table suggest a number of APIs we could offer in the future. Here, I have filled in all options which are at least coherent:</p><table style="box-sizing: border-box; border-spacing: 0px; border-collapse: collapse; margin-top: 0px; margin-bottom: 16px; display: block; width: 888px; overflow: auto; word-break: keep-all;" class=""><thead style="box-sizing: border-box;" class=""><tr style="box-sizing: border-box; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><th style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">Operand</th><th style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">Get</th><th style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">Index</th><th style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">Exclude</th><th style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">Remove (1)</th><th style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">Pop (1)</th><th style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">Equate (2)</th></tr></thead><tbody style="box-sizing: border-box;" class=""><tr style="box-sizing: border-box; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><span style="box-sizing: border-box;" class=""><b class="">Fixed Size</b></span></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""></td></tr><tr style="box-sizing: border-box; background-color: rgb(248, 248, 248); border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">First 1</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">C.first</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><span style="box-sizing: border-box;" class=""><b class="">C.firstIndex</b></span></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">S.removingFirst()</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">C.removeFirst()</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">C.popFirst()</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td></tr><tr style="box-sizing: border-box; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">Last 1</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">C.last</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><span style="box-sizing: border-box;" class=""><b class="">C.lastIndex</b></span></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">S.removingLast()</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">C.removeLast()</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">C.popLast()</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td></tr><tr style="box-sizing: border-box; background-color: rgb(248, 248, 248); border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">First (n: Int)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">S.prefix(_:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><span style="box-sizing: border-box;" class=""><b class="">C.prefixIndex(_:)</b></span></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">S.removingPrefix(_:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">C.removePrefix(_:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">S.hasPrefix(_:)</td></tr><tr style="box-sizing: border-box; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""> ...with closure</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">S.prefix(while:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><span style="box-sizing: border-box;" class=""><b class="">C.prefixIndex(while:)</b></span></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">S.removingPrefix(while:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><span style="box-sizing: border-box;" class=""><b class="">C.removePrefix(while:)</b></span></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">S.hasPrefix(_:isEquivalent:)</td></tr><tr style="box-sizing: border-box; background-color: rgb(248, 248, 248); border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">Last (n: Int)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">S.suffix(_:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><span style="box-sizing: border-box;" class=""><b class="">C.suffixIndex(_:)</b></span></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">S.removingSuffix(_:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">C.removeSuffix(_:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><span style="box-sizing: border-box;" class=""><b class="">S.hasSuffix(_:)</b></span></td></tr><tr style="box-sizing: border-box; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""> ...with closure</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><span style="box-sizing: border-box;" class=""><b class="">S.suffix(while:)</b></span></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><span style="box-sizing: border-box;" class=""><b class="">C.suffixIndex(while:)</b></span></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><span style="box-sizing: border-box;" class=""><b class="">S.removingSuffix(while:)</b></span></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><span style="box-sizing: border-box;" class=""><b class="">C.removeSuffix(while:)</b></span></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><span style="box-sizing: border-box;" class=""><b class="">S.hasSuffix(_:isEquivalent:)</b></span></td></tr><tr style="box-sizing: border-box; background-color: rgb(248, 248, 248); border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><span style="box-sizing: border-box;" class=""><b class="">Searching From End</b></span></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""></td></tr><tr style="box-sizing: border-box; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">First matching element</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><span style="box-sizing: border-box;" class=""><b class="">S.earliest(_:)</b></span></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">C.earliestIndex(of:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><span style="box-sizing: border-box;" class=""><b class="">S.removingEarliest(_:)</b></span></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><span style="box-sizing: border-box;" class=""><b class="">C.removeEarliest(_:)</b></span></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td></tr><tr style="box-sizing: border-box; background-color: rgb(248, 248, 248); border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""> ...with closure</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">S.earliest(where:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">C.earliestIndex(where:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><span style="box-sizing: border-box;" class=""><b class="">S.removingEarliest(where:)</b></span></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><span style="box-sizing: border-box;" class=""><b class="">C.removeEarliest(where:)</b></span></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td></tr><tr style="box-sizing: border-box; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">Last matching element</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><span style="box-sizing: border-box;" class=""><b class="">S.latest(_:)</b></span></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><span style="box-sizing: border-box;" class=""><b class="">C.latestIndex(of:)</b></span></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><span style="box-sizing: border-box;" class=""><b class="">S.removingLatest(_:)</b></span></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><span style="box-sizing: border-box;" class=""><b class="">C.removeLatest(_:)</b></span></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td></tr><tr style="box-sizing: border-box; background-color: rgb(248, 248, 248); border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""> ...with closure</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><span style="box-sizing: border-box;" class=""><b class="">S.latest(where:)</b></span></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><span style="box-sizing: border-box;" class=""><b class="">C.latestIndex(where:)</b></span></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><span style="box-sizing: border-box;" class=""><b class="">S.removingLatest(where:)</b></span></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><span style="box-sizing: border-box;" class=""><b class="">C.removeLatest(where:)</b></span></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td></tr></tbody></table><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class="">To explain a few entries which might not be immediately obvious: <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">firstIndex</code> and <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">lastIndex</code> would be <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">nil</code> if the collection is empty, and <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">lastIndex</code> would be the index before <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">endIndex</code>. <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">prefixIndex</code> would return the last index of the prefix, and <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">suffixIndex</code> would return the first index of the suffix; alternatively, these could be named with <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">Indices</code> and return ranges. <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">earliest(_:)</code> and <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">latest(_:)</code> would return the first and last element equal to the provided value; on a <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">Set</code>, they would be roughly equivalent to <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">NSSet.member(_:)</code>.</p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class="">The changes I consider most worthy include:</p><ul style="box-sizing: border-box; padding-left: 2em; margin-top: 0px; margin-bottom: 16px;" class=""><li style="box-sizing: border-box;" class=""><p style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;" class="">Adding corresponding <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">last</code>, <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">suffix</code>, and <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">latest</code> methods for all <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">first</code>, <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">prefix</code>, and <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">earliest</code> methods.</p></li><li style="box-sizing: border-box;" class=""><p style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;" class="">Adding corresponding <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">while:</code> versions of all appropriate prefix/suffix APIs.</p></li></ul><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class="">Ones that could be useful, but can usually be emulated with more work:</p><ul style="box-sizing: border-box; padding-left: 2em; margin-top: 0px; margin-bottom: 16px;" class=""><li style="box-sizing: border-box;" class=""><p style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;" class="">Adding <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">remove</code>/<code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">removing</code>-by-content APIs.</p></li><li style="box-sizing: border-box;" class=""><p style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;" class="">Adding <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">prefix/suffixIndex(while:)</code>.</p></li></ul><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class="">Ones that are mere conveniences or may not have strong use cases:</p><ul style="box-sizing: border-box; padding-left: 2em; margin-top: 0px; margin-bottom: 16px;" class=""><li style="box-sizing: border-box;" class=""><p style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;" class=""><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">first/lastIndex</code> and <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">prefix/suffixIndex(_:)</code>.</p></li><li style="box-sizing: border-box;" class=""><p style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;" class=""><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">earliest/latest(_:)</code>.</p></li></ul><h4 style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.4; font-size: 1.25em;" class=""><a id="user-content-all-and-every-as-operands" class="anchor" href="https://gist.github.com/brentdax/024d26c2b68b88323989540c06261430#all-and-every-as-operands" aria-hidden="true" style="box-sizing: border-box; background-color: transparent; -webkit-text-decoration-skip: objects; color: rgb(64, 120, 192); text-decoration: none; display: inline-block; padding-right: 2px; margin-left: -18px; line-height: 1.2;"><svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>"All" and "Every" as operands</h4><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class="">One could imagine adding rows to this table for "all" and "every matching". In addition to creating some useful new API, this would also suggest some interesting renaming for existing APIs:</p><ul style="box-sizing: border-box; padding-left: 2em; margin-top: 0px; margin-bottom: 16px;" class=""><li style="box-sizing: border-box;" class=""><p style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;" class=""><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">allIndices</code> would be a name for <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">indices</code>.</p></li><li style="box-sizing: border-box;" class=""><p style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;" class=""><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">removeAll()</code> is actually an existing name which happens to fit this pattern.</p></li><li style="box-sizing: border-box;" class=""><p style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;" class=""><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">every(where:)</code> would be a name for <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">filter</code>. Though I believe <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">filter</code> is a strong term of art, I do note that <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">every(where:)</code> does not cause confusion about the sense of its test, a major complaint about <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">filter</code>.</p></li></ul><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class="">In the table below, <span style="box-sizing: border-box;" class=""><b class="">bold</b></span> indicates new functionality; <em style="box-sizing: border-box;" class="">italics</em> indicates existing functionality renamed to fit this pattern.</p><table style="box-sizing: border-box; border-spacing: 0px; border-collapse: collapse; margin-top: 0px; margin-bottom: 16px; display: block; width: 888px; overflow: auto; word-break: keep-all;" class=""><thead style="box-sizing: border-box;" class=""><tr style="box-sizing: border-box; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><th style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">Operand</th><th style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">Get</th><th style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">Index</th><th style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">Exclude</th><th style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">Remove (1)</th><th style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">Pop (1)</th><th style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">Equate (2)</th></tr></thead><tbody style="box-sizing: border-box;" class=""><tr style="box-sizing: border-box; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><span style="box-sizing: border-box;" class="">Fixed Size</span></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""></td></tr><tr style="box-sizing: border-box; background-color: rgb(248, 248, 248); border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">First 1</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">C.first</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">C.firstIndex</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">S.removingFirst()</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">C.removeFirst()</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">C.popFirst()</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td></tr><tr style="box-sizing: border-box; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">Last 1</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">C.last</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">C.lastIndex</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">S.removingLast()</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">C.removeLast()</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">C.popLast()</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td></tr><tr style="box-sizing: border-box; background-color: rgb(248, 248, 248); border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">First (n: Int)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">S.prefix(_:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">C.prefixIndex(_:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">S.removingPrefix(_:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">C.removePrefix(_:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">S.hasPrefix(_:)</td></tr><tr style="box-sizing: border-box; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""> ...with closure</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">S.prefix(while:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">C.prefixIndex(while:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">S.removingPrefix(while:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">C.removePrefix(while:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">S.hasPrefix(_:isEquivalent:)</td></tr><tr style="box-sizing: border-box; background-color: rgb(248, 248, 248); border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">Last (n: Int)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">S.suffix(_:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">C.suffixIndex(_:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">S.removingSuffix(_:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">C.removeSuffix(_:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">S.hasSuffix(_:)</td></tr><tr style="box-sizing: border-box; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""> ...with closure</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">S.suffix(while:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">C.suffixIndex(while:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">S.removingSuffix(while:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">C.removeSuffix(while:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">S.hasSuffix(_:isEquivalent:)</td></tr><tr style="box-sizing: border-box; background-color: rgb(248, 248, 248); border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">All</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><em style="box-sizing: border-box;" class="">allIndices</em></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">C.removeAll()</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td></tr><tr style="box-sizing: border-box; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><span style="box-sizing: border-box;" class="">Searching From End</span></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""></td></tr><tr style="box-sizing: border-box; background-color: rgb(248, 248, 248); border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">First matching element</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">S.earliest(_:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">C.earliestIndex(of:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">S.removingEarliest(_:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">C.removeEarliest(_:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td></tr><tr style="box-sizing: border-box; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""> ...with closure</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">S.earliest(where:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">C.earliestIndex(where:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">S.removingEarliest(where:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">C.removeEarliest(where:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td></tr><tr style="box-sizing: border-box; background-color: rgb(248, 248, 248); border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">Last matching element</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">S.latest(_:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">C.latestIndex(of:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">S.removingLatest(_:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">C.removeLatest(_:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td></tr><tr style="box-sizing: border-box; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""> ...with closure</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">S.latest(where:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">C.latestIndex(where:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">S.removingLatest(where:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">C.removeLatest(where:)</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td></tr><tr style="box-sizing: border-box; background-color: rgb(248, 248, 248); border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">Every matching element</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><span style="box-sizing: border-box;" class=""><b class="">S.every(_:)</b></span></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><span style="box-sizing: border-box;" class=""><b class="">C.everyIndex(of:)</b></span></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><span style="box-sizing: border-box;" class=""><b class="">S.removingEvery(_:)</b></span></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><span style="box-sizing: border-box;" class=""><b class="">C.removeEvery(_:)</b></span></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td></tr><tr style="box-sizing: border-box; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204);" class=""><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""> ...with closure</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><em style="box-sizing: border-box;" class="">S.every(where:)</em></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><span style="box-sizing: border-box;" class=""><b class="">C.everyIndex(where:)</b></span></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><span style="box-sizing: border-box;" class=""><b class="">S.removingEvery(where:)</b></span></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class=""><span style="box-sizing: border-box;" class=""><b class="">C.removeEvery(where:)</b></span></td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td><td style="box-sizing: border-box; padding: 6px 13px; border: 1px solid rgb(221, 221, 221);" class="">-</td></tr></tbody></table><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class="">An alternative to the <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">every</code> methods is to give them names based on <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">all</code> or <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">any</code>, but these tend to require breaks from the naming patterns of the matching <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">earliest</code> and <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">latest</code> methods to remain grammatical.</p><h4 style="box-sizing: border-box; margin-top: 1em; margin-bottom: 16px; line-height: 1.4; font-size: 1.25em;" class=""><a id="user-content-additional-index-based-operations" class="anchor" href="https://gist.github.com/brentdax/024d26c2b68b88323989540c06261430#additional-index-based-operations" aria-hidden="true" style="box-sizing: border-box; background-color: transparent; -webkit-text-decoration-skip: objects; color: rgb(64, 120, 192); text-decoration: none; display: inline-block; padding-right: 2px; margin-left: -18px; line-height: 1.2;"><svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Additional index-based operations</h4><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class="">Though accessing a range of elements bounded by the end of the collection is useful, it might be useful to extend that ability to other range-based collection APIs. <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">IncompleteRange</code> would make this especially easy; we would simply overload <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">Range</code>-taking APIs to permit <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">IncompleteRange</code>s as well. However, we could also provide variants of these APIs which take a <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">to:</code>, <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">through:</code>, or <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">from:</code> index parameter in place of an index range.</p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 16px;" class="">Candidates include:</p><ul style="box-sizing: border-box; padding-left: 2em; margin-top: 0px; margin-bottom: 0px !important;" class=""><li style="box-sizing: border-box;" class=""><p style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;" class=""><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">MutableCollection.subscript(bounds: Range<Index>) { set }</code>, making the subscripts in this proposal mutable.</p></li><li style="box-sizing: border-box;" class=""><p style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;" class=""><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">RangeReplaceableCollection.removeSubrange(\_:)</code></p></li><li style="box-sizing: border-box;" class=""><p style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;" class=""><code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">RangeReplaceableCollection.replaceSubrange(\_:with:)</code></p></li><li style="box-sizing: border-box;" class=""><p style="box-sizing: border-box; margin-top: 16px; margin-bottom: 16px;" class="">The various <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">Range</code> parameters in <code style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; padding: 0.2em 0px; margin: 0px; background-color: rgba(0, 0, 0, 0.0392157); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">String</code> (although these might be better replaced with slice-based APIs).</p></li></ul></article></div></div></form></div></div><br class=""><div class="">-- <br class="">Brent Royal-Gordon<br class="">Architechies<br class=""></div><br class=""></body></html>