<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Jul 22, 2016 at 8:35 AM, Ben Rimmington <span dir="ltr">&lt;<a href="mailto:me@benrimmington.com" target="_blank">me@benrimmington.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span><br>
&gt; On 22 Jul 2016, at 02:46, Jacob Bandes-Storch wrote:<br>
&gt;<br>
&gt; In the swift-lang Slack channel, a few of us were discussing joined(separator:) and realized that flatten() does almost exactly the same thing.<br>
&gt;<br>
&gt; Is there interest in renaming flatten() to joined()?  Since joined takes a separator that&#39;s any Sequence, we can&#39;t have a default value for the separator parameter, but we can have a variant of joined() with no arguments.<br>
<br>
</span>I&#39;d like default separators for the joined() methods.<br>
<br>
&lt;<a href="https://bugs.swift.org/browse/SR-1428" rel="noreferrer" target="_blank">https://bugs.swift.org/browse/SR-1428</a>&gt;<br>
<br>
But renaming flatten() to joined() seems complicated.<br>
<br>
&lt;<a href="https://github.com/apple/swift/blob/master/stdlib/public/core/Flatten.swift.gyb" rel="noreferrer" target="_blank">https://github.com/apple/swift/blob/master/stdlib/public/core/Flatten.swift.gyb</a>&gt;<br>
&lt;<a href="https://github.com/apple/swift/blob/master/stdlib/public/core/Join.swift" rel="noreferrer" target="_blank">https://github.com/apple/swift/blob/master/stdlib/public/core/Join.swift</a>&gt;<br></blockquote><div><br></div><div>What makes it seem complicated? At the very least, one could just rename the flatten() function. There might also be an opportunity to combine the two files and delete some code from stdlib.</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
And what would happen to the flatMap() methods? Is flatten() a term of art?<br>
<br>
&lt;<a href="https://github.com/apple/swift/blob/master/stdlib/public/core/FlatMap.swift" rel="noreferrer" target="_blank">https://github.com/apple/swift/blob/master/stdlib/public/core/FlatMap.swift</a>&gt;<br></blockquote><div><br></div><div>I&#39;d say flatMap is more a &quot;term of art&quot; than flatten. &quot;flatten&quot; just describes literally what is being done. Frankly I&#39;m surprised it was never named flattened(). Anyway, flatMap should stay.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span><font color="#888888"><br>
-- Ben<br>
<br>
</font></span></blockquote></div><br></div></div>