<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><br class=""><blockquote type="cite" class=""><div class=""><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;">I’m personally grateful that Swift reminds me that, for example, I need the question mark in&nbsp;<span class="" style="font-family: Menlo; font-size: 11px; background-color: rgb(255, 255, 255);">view.</span><span class="" style="color: rgb(88, 126, 168); font-family: Menlo; font-size: 11px; background-color: rgb(255, 255, 255);">gestureRecognizers</span><span class="" style="font-family: Menlo; font-size: 11px; background-color: rgb(255, 255, 255);">?.</span><span class="" style="color: rgb(88, 126, 168); font-family: Menlo; font-size: 11px; background-color: rgb(255, 255, 255);">count</span>. It would be maddening if&nbsp;<span class="" style="font-family: Menlo; font-size: 11px; background-color: rgb(255, 255, 255);">view.</span><span class="" style="color: rgb(88, 126, 168); font-family: Menlo; font-size: 11px; background-color: rgb(255, 255, 255);">gestureRecognizers</span><span class="" style="font-family: Menlo; font-size: 11px; background-color: rgb(255, 255, 255);">.</span><span class="" style="color: rgb(88, 126, 168); font-family: Menlo; font-size: 11px; background-color: rgb(255, 255, 255);">count</span>&nbsp;compiled, and always returned either 0 or 1. Imagine it!</div></div></blockquote><blockquote type="cite" class=""><div class=""><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class="" style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(88, 126, 168); background-color: rgb(255, 255, 255);"><span class="" style="">&nbsp; &nbsp;&nbsp;view.</span>gestureRecognizers<span class="" style="">.</span>count<span class="" style="">&nbsp;<span class="Apple-converted-space">&nbsp;</span></span><span class="" style="color: rgb(102, 139, 73);">// returns 0</span></div><div class="" style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(88, 126, 168); background-color: rgb(255, 255, 255);"><span class="" style="">&nbsp; &nbsp; view.</span>gestureRecognizers<span class="" style=""><span class="Apple-converted-space">&nbsp;</span>= []</span></div><div class="" style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(88, 126, 168); background-color: rgb(255, 255, 255);"><span class="" style="">&nbsp; &nbsp; view.</span>gestureRecognizers<span class="" style="">.</span>count<span class="" style="">&nbsp;<span class="Apple-converted-space">&nbsp;</span></span><span class="" style="color: rgb(102, 139, 73);">// now returns 1 (wat?)</span></div></div><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class=""><div class="" style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(88, 126, 168); background-color: rgb(255, 255, 255);"><span class="" style="">&nbsp; &nbsp;&nbsp;view.</span>gestureRecognizers<span class="" style="">&nbsp;= [foo, bar, baz]</span></div><div class="" style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(88, 126, 168); background-color: rgb(255, 255, 255);"><span class="" style="">&nbsp; &nbsp;&nbsp;view.</span>gestureRecognizers<span class="" style="">.</span>count<span class="" style="">&nbsp;&nbsp;</span><span class="" style="color: rgb(102, 139, 73);">// still returns 1</span><span class="" style="color: rgb(102, 139, 73);">&nbsp;</span><span class="" style="color: rgb(102, 139, 73);">(wat?!)</span></div></div></div><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span class="" style="color: rgb(102, 139, 73);"><br class=""></span></div><div class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;">That is a recipe for torches and pitchforks right there. Yet it is analogous to what flatMap currently does.</div></div></blockquote></div><div><br class=""></div><div>[OT: NSView always returns an array here (which can be empty), and I think it is the right choice to avoid optional collections]</div><div><br class=""></div><div class="">Even if the proposal is accepted, you still could do</div><div class=""><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(112, 61, 170); background-color: rgb(255, 255, 255);" class=""><span style="color: #4f8187" class="">v</span><span style="color: #000000" class="">.</span>gestureRecognizers<span style="color: #000000" class="">.</span><span style="color: #3e1e81" class="">flatMap</span><span style="color: #000000" class=""> {</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(62, 30, 129); background-color: rgb(255, 255, 255);" class=""><span style="color: #000000" class=""><span class="Apple-tab-span" style="white-space:pre">        </span></span>print<span style="color: #000000" class="">($0)</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class="">}</div></div><div class="">as well as</div><div class=""><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(112, 61, 170); background-color: rgb(255, 255, 255);" class=""><span style="color: #4f8187" class="">v</span><span style="color: #000000" class="">.</span>gestureRecognizers<span style="color: #000000" class="">?.</span><span style="color: #3e1e81" class="">flatMap</span><span style="color: #000000" class=""> {</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; color: rgb(62, 30, 129); background-color: rgb(255, 255, 255);" class=""><span style="color: #000000" class=""><span class="Apple-tab-span" style="white-space:pre">        </span></span>print<span style="color: #000000" class="">($0)</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class="">}</div></div><div class=""><br class=""></div><div class="">So we are not talking about fully abandoning the concept of a container with a flatMap-method, but rather break one part, and leave the other dangling around.</div></body></html>