<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">On Nov 9, 2017, at 11:36 AM, Kevin Ballard via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:<br class=""><div><blockquote type="cite" class=""><br class="Apple-interchange-newline"><div class="">


<title class=""></title>

<div class=""><div class="">On Wed, Nov 8, 2017, at 09:29 PM, Paul Cantrell via swift-evolution wrote:<br class=""></div>
<blockquote type="cite" class=""><div style="word-wrap:break-word;line-break:after-white-space;" class=""><div class=""><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-stretch:normal;line-height:normal;background-color:rgb(255, 255, 255);" class=""><div class="">The problem in the Doodads example is that <b class="">the name&nbsp;<span class="colour" style="color:rgb(88, 126, 168)"><span class="font" style="font-family:Menlo"><span class="size" style="font-size:11px">flatMap</span></span></span>&nbsp;is used to identify two distinct intents</b>: concatenating arrays and filtering nils. One can argue that those two operations are, in some lofty abstract sense, if you squint, two instances of some more general pattern — but I don’t think it’s fair to say that they represent the same <i class="">intent</i>. These separate intents deserve separate names.<br class=""></div>
</div>
</div>
</div>
</blockquote><div class=""><br class=""></div>
<div class="">They absolutely represent the same intent if you think of an optional as a collection of zero or one elements.</div>
<div class=""><br class=""></div>
<div class="">-Kevin Ballard</div>
</div></div></blockquote></div><br class=""><div class="">But as `Optional` does not conform to collection, I would suggest that the vast majority of of developers do _not_ think of them as a collection of zero or one elements. (I certainly don’t know any who naturally think of it that way.) We don’t treat Optional as a collection anywhere else in the API, and it seems odd to do so in just this one case.</div><div class=""><br class=""></div><div class="">-BJ</div></div></body></html>