<div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span style="font-size:13px">-1, for the same reasons stated on the thread. These are neither guaranteed to be mutating or non-mutating until you get to Collection.</span><br>Changing map() to mapped() would be lying to the developer some of the time about the mutability of the interface.<br>-DW</blockquote><div><br></div><div>Actually the -ed/-ing suffix is <b>not </b>intended to guarantee non-mutatability. It merely communicates whether it is a "return-a-transformed-version-of-the-instance"-type method as opposed to an in-place mutation. Clearly these are not in-place forms. Note that this is my interpretation of the intent of the guidelines (or what should be the intent) – if the core team agrees perhaps this deserves clarification in the document.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span style="font-size:13px">These functions are different than for example `sort` because there can’t be a general mutating method of `map`. A variable of type `[A]` can’t be mutated to hold a `[B]` which would be the result of a map from `A -> B`.</span></blockquote><div><br></div><div>There could definitely be an in-place variant of filter. While a <i>fully</i> general method would not be possible for the others, an user might reasonable expect in-place variants of map/flatMap if T == U as with e.g. { $0 * 2 } or Optionals, and of dropFirst/dropLast if SubSequence == Sequence as with e.g. String.</div><div><br></div><div>Also note that the -ed/-ing rule should not be merely for ambiguous cases, it should tell the user that the main use of the method is returning a transformed version of the instance. Having this be a rule you can depend on is important.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span style="font-size:13px">-1 The Term of Art argument is very strong with these functions. I prefer them as-is.</span></blockquote><div><br></div><div>What specific benefits do we obtain from using the <i>exact </i>terms of art vs. the very slightly modified versions proposed?</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jun 17, 2016 at 3:24 AM, Brent Royal-Gordon via swift-evolution <span dir="ltr"><<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">> The 'reduce()' at its core take an array of element and reduce it to single element (could be of a different type) as such it cannot ever be mutating (if one really want it, one could reduce an array to the same array but it is not the goal of the function). For this one it sound to me nearly like asking to rename 'max()' to 'maxed()', 'count' to 'counted' or implement a 'summed()' instead of a 'sum()' for [Int].<br>
<br>
</span>`max`, `count`, and `sum` are all nouns—at least in the senses they are meant in those calls—so they do not take the -ed/-ing suffixes to form immutable variants. Instead, they would take the `form` prefix to form mutable variants, if they had them.<br>
<br>
`map`, `filter`, and `reduce`—at least in the senses they must be interpreted in for the names of those calls to make sense—are verbs, and so they *would* normally take -ed/-ing suffixes. However, as broadly-accepted terms of art, we have left them alone until now.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Brent Royal-Gordon<br>
Architechies<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
</div></div></blockquote></div><br></div>