<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><blockquote type="cite" class=""><div class="">On Jan 8, 2016, at 2:36 AM, Craig Cruden via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><blockquote type="cite" class=""><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class=""><div class=""><div class=""><div class=""><blockquote type="cite" class=""><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class=""><div class=""><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><font color="#bb2ca2" class="">let commission =&nbsp;</font><span class="" style="color: rgb(79, 129, 135);">trade</span><span class="">.map {</span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="color: rgb(187, 44, 162);"><span class="Apple-tab-span" style="white-space: pre;">        </span>case</span>&nbsp;.Buy(<span class="" style="color: rgb(187, 44, 162);">let</span>&nbsp;quantity,&nbsp;<span class="" style="color: rgb(187, 44, 162);">let</span>&nbsp;price)&nbsp;<span class="" style="color: rgb(187, 44, 162);">where</span>&nbsp;<span class="" style="color: rgb(112, 61, 170);">Double</span>(quantity) * price &gt;&nbsp;<span class="" style="color: rgb(39, 42, 216);">10000 in</span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;">&nbsp; &nbsp;&nbsp;<span class="Apple-tab-span" style="white-space: pre;">                </span><span class="" style="color: rgb(112, 61, 170);">Double</span>(quantity) * price *&nbsp;<span class="" style="color: rgb(79, 129, 135);">vipCommissionRate</span>&nbsp;/&nbsp;<span class="" style="color: rgb(39, 42, 216);">100</span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="color: rgb(187, 44, 162);"><span class="Apple-tab-span" style="white-space: pre;">        </span>case</span>&nbsp;.Buy(<span class="" style="color: rgb(187, 44, 162);">let</span>&nbsp;quantity,&nbsp;<span class="" style="color: rgb(187, 44, 162);">let</span>&nbsp;price) in</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;">&nbsp; &nbsp;&nbsp;<span class="Apple-tab-span" style="white-space: pre;">                </span><span class="" style="color: rgb(112, 61, 170);">Double</span>(quantity) * price *&nbsp;<span class="" style="color: rgb(79, 129, 135);">commissionRate</span>&nbsp;/&nbsp;<span class="" style="color: rgb(39, 42, 216);">100</span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="color: rgb(187, 44, 162);"><span class="Apple-tab-span" style="white-space: pre;">        </span>case</span>&nbsp;.Sell(<span class="" style="color: rgb(187, 44, 162);">let</span>&nbsp;quantity,&nbsp;<span class="" style="color: rgb(187, 44, 162);">let</span>&nbsp;price)&nbsp;<span class="" style="color: rgb(187, 44, 162);">where</span>&nbsp;<span class="" style="color: rgb(112, 61, 170);">Double</span>(quantity) * price &gt;&nbsp;<span class="" style="color: rgb(39, 42, 216);">10000 in</span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;">&nbsp; &nbsp;&nbsp;<span class="Apple-tab-span" style="white-space: pre;">                </span><span class="" style="color: rgb(112, 61, 170);">Double</span>(quantity) * price *&nbsp;<span class="" style="color: rgb(79, 129, 135);">vipCommissionRate</span>&nbsp;/&nbsp;<span class="" style="color: rgb(39, 42, 216);">100</span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="color: rgb(187, 44, 162);"><span class="Apple-tab-span" style="white-space: pre;">        </span>case</span>&nbsp;.Sell(<span class="" style="color: rgb(187, 44, 162);">let</span>&nbsp;quantity,&nbsp;<span class="" style="color: rgb(187, 44, 162);">let</span>&nbsp;price) in</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;">&nbsp; &nbsp;&nbsp;<span class="Apple-tab-span" style="white-space: pre;">                </span><span class="" style="color: rgb(112, 61, 170);">Double</span>(quantity) * price *&nbsp;<span class="" style="color: rgb(79, 129, 135);">commissionRate</span>&nbsp;/&nbsp;<span class="" style="color: rgb(39, 42, 216);">100</span></div></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="color: rgb(39, 42, 216);">}</span></div></div></div></div></blockquote></div></div></div></div></div></div></blockquote></div></blockquote><br class=""></div><div>Is there any reason it couldn’t be “switchMap” instead of “map”? Would follow the design of “flatMap” naming. It would also help explain what is happening by mapping based on a switch statement.</div><div><br class=""></div><div><blockquote type="cite" class=""></blockquote><font color="#bb2ca2" class="" style="font-family: Menlo; font-size: 11px;">let commission =&nbsp;</font><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(79, 129, 135);">trade</span><span class="" style="font-family: Menlo; font-size: 11px;">.switchMap {</span></div><div><font face="Menlo" class=""><span style="font-size: 11px;" class=""><br class=""></span></font><blockquote type="cite" class=""></blockquote><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(187, 44, 162);">&nbsp; &nbsp; case</span><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp;.Buy(</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(187, 44, 162);">let</span><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp;quantity,&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(187, 44, 162);">let</span><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp;price)&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(187, 44, 162);">where</span><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(112, 61, 170);">Double</span><span style="font-family: Menlo; font-size: 11px;" class="">(quantity) * price &gt;&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(39, 42, 216);">10000 in</span><br class=""><blockquote type="cite" class=""></blockquote><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp; &nbsp;&nbsp;</span><span class="Apple-tab-span" style="font-family: Menlo; font-size: 11px; white-space: pre;">                </span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(112, 61, 170);">Double</span><span style="font-family: Menlo; font-size: 11px;" class="">(quantity) * price *&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(79, 129, 135);">vipCommissionRate</span><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp;/&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(39, 42, 216);">100</span><br class=""><blockquote type="cite" class=""></blockquote><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(187, 44, 162);">&nbsp; &nbsp; case</span><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp;.Buy(</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(187, 44, 162);">let</span><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp;quantity,&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(187, 44, 162);">let</span><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp;price) in</span><br class=""><blockquote type="cite" class=""></blockquote><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp; &nbsp;&nbsp;</span><span class="Apple-tab-span" style="font-family: Menlo; font-size: 11px; white-space: pre;">                </span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(112, 61, 170);">Double</span><span style="font-family: Menlo; font-size: 11px;" class="">(quantity) * price *&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(79, 129, 135);">commissionRate</span><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp;/&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(39, 42, 216);">100</span><br class=""><blockquote type="cite" class=""></blockquote><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(187, 44, 162);">&nbsp; &nbsp; case</span><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp;.Sell(</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(187, 44, 162);">let</span><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp;quantity,&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(187, 44, 162);">let</span><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp;price)&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(187, 44, 162);">where</span><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(112, 61, 170);">Double</span><span style="font-family: Menlo; font-size: 11px;" class="">(quantity) * price &gt;&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(39, 42, 216);">10000 in</span><br class=""><blockquote type="cite" class=""></blockquote><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp; &nbsp;&nbsp;</span><span class="Apple-tab-span" style="font-family: Menlo; font-size: 11px; white-space: pre;">                </span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(112, 61, 170);">Double</span><span style="font-family: Menlo; font-size: 11px;" class="">(quantity) * price *&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(79, 129, 135);">vipCommissionRate</span><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp;/&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(39, 42, 216);">100</span><br class=""><blockquote type="cite" class=""></blockquote><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(187, 44, 162);">&nbsp; &nbsp; case</span><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp;.Sell(</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(187, 44, 162);">let</span><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp;quantity,&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(187, 44, 162);">let</span><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp;price) in</span><br class=""><blockquote type="cite" class=""></blockquote><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp; &nbsp;&nbsp;</span><span class="Apple-tab-span" style="font-family: Menlo; font-size: 11px; white-space: pre;">                </span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(112, 61, 170);">Double</span><span style="font-family: Menlo; font-size: 11px;" class="">(quantity) * price *&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(79, 129, 135);">commissionRate</span><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp;/&nbsp;</span><span class="" style="font-family: Menlo; font-size: 11px; color: rgb(39, 42, 216);">100</span></div><div><font color="#272ad8" face="Menlo" class=""><span style="font-size: 11px;" class=""><br class=""></span></font><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class=""><div class=""><div class=""><div class=""><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class=""><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span class="" style="color: rgb(39, 42, 216);">}</span></div></div></div></div></div></div></div></div></div></div></div><div><br class=""></div><div apple-content-edited="true" class="">
<br class="Apple-interchange-newline"><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class=""><font color="#8d8d8d" class=""><span class="Apple-converted-space">&nbsp;</span>Nerd . Designer . Developer</font></span><font color="#464646" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Jo Albright</span></font><br style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""></div><br class=""><br class=""></body></html>