<html><body><div><br></div><div><br>Am 09. Februar 2016 um 14:47 schrieb Dany St-Amant via swift-evolution <swift-evolution@swift.org>:<br><br><div><blockquote type="cite"><div class="msg-quote" style="word-wrap: break-word;" data-mce-style="word-wrap: break-word;"><br class=""><div><blockquote type="cite" class=""><div class="">Le 9 févr. 2016 à 01:00, Thorsten Seitz <<a href="mailto:tseitz42@icloud.com" class="" data-mce-href="mailto:tseitz42@icloud.com">tseitz42@icloud.com</a>> a écrit :</div><br class="Apple-interchange-newline"><div class=""><div style="font-family: 'helvetica'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="" data-mce-style="font-family: 'helvetica'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><br class="Apple-interchange-newline"><br class="">Am 09.02.2016 um 01:51 schrieb Dany St-Amant via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="" data-mce-href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>>:<br class=""><br class=""></div><blockquote type="cite" style="font-family: 'helvetica'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="" data-mce-style="font-family: 'helvetica'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><div class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">Le 8 févr. 2016 à 10:54, Thorsten Seitz <<a href="mailto:tseitz42@icloud.com" class="" data-mce-href="mailto:tseitz42@icloud.com">tseitz42@icloud.com</a>> a écrit :</div><br class="Apple-interchange-newline"><div class=""><div dir="auto" class=""><div class=""><br></div><div class=""><br class=""></div><div class=""><br class="">Am 07.02.2016 um 16:47 schrieb Dany St-Amant via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="" data-mce-href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>>:<br class=""><br class=""></div><blockquote type="cite" class=""><span class="">Assuming this implicit return part of this proposal get generalized, could we instead of the dedicated match function have a generic way to feed the parameters to the closure at the start, where it would make sense for the desired switch usage.</span><br class=""><span class=""></span><br class=""><span class="">let str:String = (state) -> { switch $0 { case .Cold: "Too Cold"; case .Hot: "Too Hot"; default: "Just right" } }</span></blockquote><br class=""><div class="">That's easy, just use the match() function from the proposal:</div><div class=""><br class=""></div><div class=""><div class=""><span><span class="" style="background-color: rgba(255 , 255 , 255 , 0);" data-mce-style="background-color: rgba(255 , 255 , 255 , 0);">let str:String = match(state) { switch $0 { case .Cold: "Too Cold"; case .Hot: "Too Hot"; default: "Just right" } }</span></span></div></div><div class=""><span><span class="" style="background-color: rgba(255 , 255 , 255 , 0);" data-mce-style="background-color: rgba(255 , 255 , 255 , 0);"><br class=""></span></span></div><div class=""><span><span class="" style="background-color: rgba(255 , 255 , 255 , 0);" data-mce-style="background-color: rgba(255 , 255 , 255 , 0);">No new syntax needed for that.</span></span></div></div></div></blockquote><br class=""></div><div class="">As/if the implicit returns is generalized, I feel that match is bit out of place in the for nested if. I should have provided an example to clarify my thought. Here’s one, where the :? do a better job, but this thread has its origin in came people not liking this sometime cryptic operator (which I like to use)</div></div></blockquote><div style="font-family: 'helvetica'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="" data-mce-style="font-family: 'helvetica'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><br class=""></div><span style="font-family: 'helvetica'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; float: none; display: inline;" class="" data-mce-style="font-family: 'helvetica'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; float: none; display: inline;">I like :? too, btw.</span><div style="font-family: 'helvetica'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="" data-mce-style="font-family: 'helvetica'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><br class=""><blockquote type="cite" class=""><div class=""><div class=""><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: 'menlo';" data-mce-style="margin: 0px; font-size: 11px; line-height: normal; font-family: 'menlo';"> <span class="" style="color: #4f8187;" data-mce-style="color: #4f8187;">str</span><span class="Apple-converted-space"> </span>= major ><span class="Apple-converted-space"> </span><span class="" style="color: #272ad8;" data-mce-style="color: #272ad8;">0</span><span class="Apple-converted-space"> </span>?<span class="Apple-converted-space"> </span><span class="" style="color: #d12f1b;" data-mce-style="color: #d12f1b;">"Major"</span><span class="Apple-converted-space"> </span>: minor ><span class="Apple-converted-space"> </span><span class="" style="color: #272ad8;" data-mce-style="color: #272ad8;">0</span><span class="Apple-converted-space"> </span>?<span class="Apple-converted-space"> </span><span class="" style="color: #d12f1b;" data-mce-style="color: #d12f1b;">"Minor"</span><span class="Apple-converted-space"> </span>:<span class="Apple-converted-space"> </span><span class="" style="color: #d12f1b;" data-mce-style="color: #d12f1b;">"None"</span></div><div class=""><span class="" style="color: #d12f1b;" data-mce-style="color: #d12f1b;"><br class=""></span></div></div><div class="">which is ill suited for switch case but doable.</div></div></blockquote><div class=""><br class=""></div>No need to press something into switch which does not fit.</div><div style="font-family: 'helvetica'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="" data-mce-style="font-family: 'helvetica'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">The proposal is not about using switch for everything and it is not about replacing the ternary operator. It is more about making a switch expression available.</div></div></blockquote><div><br class=""></div>Of course, it’s not about what should remain unmentioned (saying it out loud three time may cause that thread to come back and haunt us).</div></div></blockquote></div><div><span><br data-mce-bogus="1"></span></div><div><span>:-)</span></div><div><span><br data-mce-bogus="1"></span></div><div><span> <br></span><blockquote type="cite"><div class="msg-quote" style="word-wrap: break-word;" data-mce-style="word-wrap: break-word;"><div></div><div>But while the proposal can be mainly read as:</div><div><br class=""></div><div>- provide a special case-list closure (aka pattern matching partial function dedicated to switch) and expand implicit returns support for this closure type only.</div><div><br class=""></div><div>it could also be read as</div><div><br class=""></div><div>- expand the implicit returns support for all closure, allow such closure to skip the switch keyword; be the case list (aka pattern matching partial function).</div></div></blockquote></div><div><span><br data-mce-bogus="1"></span></div><div><span>Implicit return already does work for an expression (and it wouldn't make much sense elsewhere) and the case list should be an expression. Maybe this has to be stated more explicitly?<br></span></div><div><span><br data-mce-bogus="1"></span></div><div><span> <br></span><blockquote type="cite"><div class="msg-quote" style="word-wrap: break-word;" data-mce-style="word-wrap: break-word;"><div></div><div>I do think that safely expanding the implicit returns support in either the dedicated closure or the general closure would be roughly the same.</div></div></blockquote></div><div><span><br data-mce-bogus="1"></span></div><div><span>I think type inference when using implicit return has to be improved. This might be a separate proposal.<br data-mce-bogus="1"></span></div><div><span> </span></div><div><span><br data-mce-bogus="1"></span></div><div><blockquote type="cite"><div class="msg-quote" style="word-wrap: break-word;" data-mce-style="word-wrap: break-word;"><div></div><div>I’m not sure where I stand on the switch-less case-list closure, but I am afraid that providing such dedicated closure syntax may set a precedent and cause others to want yet another dedicated closure syntax for their own goal; how do we consider a special closure syntax as acceptable, how many of them are too many. </div></div></blockquote></div><div><span><br data-mce-bogus="1"></span></div><div><span>Fair enough.</span></div><div><span><br data-mce-bogus="1"></span></div><div><span>-Thorsten<br data-mce-bogus="1"></span></div><div><span><br data-mce-bogus="1"></span></div><div><span> <br></span><blockquote type="cite"><div class="msg-quote" style="word-wrap: break-word;" data-mce-style="word-wrap: break-word;"><div>This is why, I’m looking at it from a wide angle view; an expanded implicit returns support safely done could benefit other general cases. Doing this as a first step, will miss 50% of this proposal (still need to use switch ($0)), but the overall use case goal will still be achieved; being able to do something like; let something = condition ? data1 : data2; for more complex scenarios.</div><div><br class=""></div><div>I’m having trouble following my own train of thought, but I think it’s leading me toward having the "safely expanded implicit returns » portion extracted as its own proposal for general purpose, which this proposal can then rely on.</div></div></blockquote></div><span></span><div><blockquote type="cite"><div class="msg-quote" style="word-wrap: break-word;" data-mce-style="word-wrap: break-word;"><div><br class=""><blockquote type="cite" class=""><div class=""><div style="font-family: 'helvetica'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="" data-mce-style="font-family: 'helvetica'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><br class=""><blockquote type="cite" class=""><div class=""><div class=""><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: 'menlo';" data-mce-style="margin: 0px; font-size: 11px; line-height: normal; font-family: 'menlo';"> <span class="" style="color: #bb2ca2;" data-mce-style="color: #bb2ca2;">switch</span><span class="Apple-converted-space"> </span>(major,minor) {</div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: 'menlo';" data-mce-style="margin: 0px; font-size: 11px; line-height: normal; font-family: 'menlo';"> <span class="Apple-converted-space"> </span><span class="" style="color: #bb2ca2;" data-mce-style="color: #bb2ca2;">case</span><span class="Apple-converted-space"> </span>(<span style="color: #bb2ca2;" data-mce-style="color: #bb2ca2;" color="#bb2ca2">_</span>,<span class="Apple-converted-space"> </span><span class="" style="color: #bb2ca2;" data-mce-style="color: #bb2ca2;">_</span>)<span class="Apple-converted-space"> </span><span class="" style="color: #bb2ca2;" data-mce-style="color: #bb2ca2;">where</span><span class="Apple-converted-space"> </span>major ><span class="Apple-converted-space"> </span><span class="" style="color: #272ad8;" data-mce-style="color: #272ad8;">0</span>:<span class="Apple-converted-space"> </span><span class="" style="color: #4f8187;" data-mce-style="color: #4f8187;">str</span>=<span class="" style="color: #d12f1b;" data-mce-style="color: #d12f1b;">"Major"</span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: 'menlo';" data-mce-style="margin: 0px; font-size: 11px; line-height: normal; font-family: 'menlo';"> <span class="Apple-converted-space"> </span><span class="" style="color: #bb2ca2;" data-mce-style="color: #bb2ca2;">case</span><span class="Apple-converted-space"> </span>(<span class="" style="color: #bb2ca2;" data-mce-style="color: #bb2ca2;">_</span>,<span class="Apple-converted-space"> </span><span style="color: #bb2ca2;" data-mce-style="color: #bb2ca2;" color="#bb2ca2">_</span>)<span class="Apple-converted-space"> </span><span class="" style="color: #bb2ca2;" data-mce-style="color: #bb2ca2;">where</span><span class="Apple-converted-space"> </span>minor ><span class="Apple-converted-space"> </span><span class="" style="color: #272ad8;" data-mce-style="color: #272ad8;">0</span>:<span class="Apple-converted-space"> </span><span class="" style="color: #4f8187;" data-mce-style="color: #4f8187;">str</span>=<span class="" style="color: #d12f1b;" data-mce-style="color: #d12f1b;">"Minor"</span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: 'menlo';" data-mce-style="margin: 0px; font-size: 11px; line-height: normal; font-family: 'menlo';"> <span class="Apple-converted-space"> </span><span class="" style="color: #bb2ca2;" data-mce-style="color: #bb2ca2;">default</span>:<span class="Apple-converted-space"> </span><span class="" style="color: #4f8187;" data-mce-style="color: #4f8187;">str</span>=<span class="" style="color: #d12f1b;" data-mce-style="color: #d12f1b;">"None"</span></div><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: 'menlo';" data-mce-style="margin: 0px; font-size: 11px; line-height: normal; font-family: 'menlo';"> }</div></div></div></blockquote><div class=""><br class=""></div>Rewriting a little bit I don't think switch looks that bad even for your example:</div><div style="font-family: 'helvetica'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="" data-mce-style="font-family: 'helvetica'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><br class=""></div><div style="font-family: 'helvetica'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="" data-mce-style="font-family: 'helvetica'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><div class="" style="margin: 0px; line-height: normal;" data-mce-style="margin: 0px; line-height: normal;"><span><span style="background-color: rgba(255 , 255 , 255 , 0);" class="" data-mce-style="background-color: rgba(255 , 255 , 255 , 0);"><span class="">switch</span> (major,minor) {</span></span></div><div class="" style="margin: 0px; line-height: normal;" data-mce-style="margin: 0px; line-height: normal;"><span><span style="background-color: rgba(255 , 255 , 255 , 0);" class="" data-mce-style="background-color: rgba(255 , 255 , 255 , 0);"><span class="">case</span> <span>_</span> <span class="">where</span> major > <span class="">0</span>: <span class="">"Major"</span></span></span></div><div class="" style="margin: 0px; line-height: normal;" data-mce-style="margin: 0px; line-height: normal;"><span><span style="background-color: rgba(255 , 255 , 255 , 0);" class="" data-mce-style="background-color: rgba(255 , 255 , 255 , 0);"><span class="">case</span> <span class="">_ </span><span class="">where</span> minor > <span class="">0</span>: <span class="">"Minor"</span></span></span></div><div class="" style="margin: 0px; line-height: normal;" data-mce-style="margin: 0px; line-height: normal;"><span><span style="background-color: rgba(255 , 255 , 255 , 0);" class="" data-mce-style="background-color: rgba(255 , 255 , 255 , 0);"><span class="">default</span>: <span class="">"None"</span></span></span></div><div class="" style="margin: 0px; line-height: normal;" data-mce-style="margin: 0px; line-height: normal;"><span><span style="background-color: rgba(255 , 255 , 255 , 0);" class="" data-mce-style="background-color: rgba(255 , 255 , 255 , 0);">}</span></span></div></div><div style="font-family: 'helvetica'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="" data-mce-style="font-family: 'helvetica'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><br class=""><div class=""><div class=""><div class=""><br class=""></div><div class=""><br></div></div></div></div><div style="font-family: 'helvetica'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="" data-mce-style="font-family: 'helvetica'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><br></div><blockquote type="cite" style="font-family: 'helvetica'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="" data-mce-style="font-family: 'helvetica'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><div class=""><div class=""><div class=""><div class="">Assuming that the implicit returns is generalized to all closures (and even functions like getter), of course only for the one matching my safety rule (in short single statement/function call/exhaustive if or switch). The if can be express as, using the new global match function:</div><div class=""><br class=""></div><div class=""><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: 'menlo';" data-mce-style="margin: 0px; font-size: 11px; line-height: normal; font-family: 'menlo';"> <span class="" style="color: #4f8187;" data-mce-style="color: #4f8187;">str</span><span class="Apple-converted-space"> </span>= match(major,minor){<span class="Apple-converted-space"> </span><span class="" style="color: #bb2ca2;" data-mce-style="color: #bb2ca2;">if</span><span class="Apple-converted-space"> </span>$0 ><span class="Apple-converted-space"> </span><span class="" style="color: #272ad8;" data-mce-style="color: #272ad8;">0</span><span class="Apple-converted-space"> </span>{<span class="Apple-converted-space"> </span><span class="" style="color: #d12f1b;" data-mce-style="color: #d12f1b;">"Major"</span><span class="Apple-converted-space"> </span>}<span class="Apple-converted-space"> </span><span class="" style="color: #bb2ca2;" data-mce-style="color: #bb2ca2;">else</span><span class="Apple-converted-space"> </span><span class="" style="color: #bb2ca2;" data-mce-style="color: #bb2ca2;">if</span><span class="Apple-converted-space"> </span>$1 ><span class="Apple-converted-space"> </span><span class="" style="color: #272ad8;" data-mce-style="color: #272ad8;">0</span><span class="Apple-converted-space"> </span>{<span class="Apple-converted-space"> </span><span class="" style="color: #d12f1b;" data-mce-style="color: #d12f1b;">"Minor"</span><span class="Apple-converted-space"> </span>}<span class="Apple-converted-space"> </span><span class="" style="color: #bb2ca2;" data-mce-style="color: #bb2ca2;">else</span><span class="Apple-converted-space"> </span>{<span class="Apple-converted-space"> </span><span class="" style="color: #d12f1b;" data-mce-style="color: #d12f1b;">"None"</span><span class="Apple-converted-space"> </span>} }</div></div></div></div><div class=""><br class=""></div></div></blockquote><br style="font-family: 'helvetica'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="" data-mce-style="font-family: 'helvetica'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><div style="font-family: 'helvetica'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="" data-mce-style="font-family: 'helvetica'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">Making `if` into an expression (which would be a requirementbhere) has been more or less ruled out by Chris Lattner. </div></div></blockquote><div><br class=""></div>I recall some oppositions early on, but I do not recall if it was before the thread move into closure territory.</div><div>Don’t forget my example here as two big if:</div><div>- if we generalized the implicit return done safely to any closure.</div><div>- if we try to call the closure passing the parameters with the only (to be) available prefix syntax<br class=""><br class="">Dany</div><div><br class=""><blockquote type="cite" class=""><div style="font-family: 'helvetica'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="" data-mce-style="font-family: 'helvetica'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><br class=""></div><blockquote type="cite" style="font-family: 'helvetica'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="" data-mce-style="font-family: 'helvetica'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><div class=""><div class=""><div class=""><div class=""><br class=""></div><div class="">or using normal inline closure calls:</div><div class=""><br class=""></div><div class=""><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: 'menlo';" data-mce-style="margin: 0px; font-size: 11px; line-height: normal; font-family: 'menlo';"> <span class="" style="color: #4f8187;" data-mce-style="color: #4f8187;">str</span><span class="Apple-converted-space"> </span>= {<span class="Apple-converted-space"> </span><span class="" style="color: #bb2ca2;" data-mce-style="color: #bb2ca2;">if</span><span class="Apple-converted-space"> </span>$0 ><span class="Apple-converted-space"> </span><span class="" style="color: #272ad8;" data-mce-style="color: #272ad8;">0</span><span class="Apple-converted-space"> </span>{<span class="Apple-converted-space"> </span><span class="" style="color: #d12f1b;" data-mce-style="color: #d12f1b;">"Major"</span><span class="Apple-converted-space"> </span>}<span class="Apple-converted-space"> </span><span class="" style="color: #bb2ca2;" data-mce-style="color: #bb2ca2;">else</span><span class="Apple-converted-space"> </span><span class="" style="color: #bb2ca2;" data-mce-style="color: #bb2ca2;">if</span><span class="Apple-converted-space"> </span>$1 ><span class="Apple-converted-space"> </span><span class="" style="color: #272ad8;" data-mce-style="color: #272ad8;">0</span><span class="Apple-converted-space"> </span>{<span class="Apple-converted-space"> </span><span class="" style="color: #d12f1b;" data-mce-style="color: #d12f1b;">"Minor"</span><span class="Apple-converted-space"> </span>}<span class="Apple-converted-space"> </span><span class="" style="color: #bb2ca2;" data-mce-style="color: #bb2ca2;">else</span><span class="Apple-converted-space"> </span>{<span class="Apple-converted-space"> </span><span class="" style="color: #d12f1b;" data-mce-style="color: #d12f1b;">"None"</span><span class="Apple-converted-space"> </span>} }(major,minor)</div></div><div class=""><br class=""></div><div class="">versus the feeding I wonder about:</div><div class=""><br class=""></div><div class=""><div class="" style="margin: 0px; font-size: 11px; line-height: normal; font-family: 'menlo';" data-mce-style="margin: 0px; font-size: 11px; line-height: normal; font-family: 'menlo';"> <span class="" style="color: #4f8187;" data-mce-style="color: #4f8187;">str</span><span class="Apple-converted-space"> </span>= (major,minor) -> {<span class="Apple-converted-space"> </span><span class="" style="color: #bb2ca2;" data-mce-style="color: #bb2ca2;">if</span><span class="Apple-converted-space"> </span>$0 ><span class="Apple-converted-space"> </span><span class="" style="color: #272ad8;" data-mce-style="color: #272ad8;">0</span><span class="Apple-converted-space"> </span>{<span class="Apple-converted-space"> </span><span class="" style="color: #d12f1b;" data-mce-style="color: #d12f1b;">"Major"</span><span class="Apple-converted-space"> </span>}<span class="Apple-converted-space"> </span><span class="" style="color: #bb2ca2;" data-mce-style="color: #bb2ca2;">else</span><span class="Apple-converted-space"> </span><span class="" style="color: #bb2ca2;" data-mce-style="color: #bb2ca2;">if</span><span class="Apple-converted-space"> </span>$1 ><span class="Apple-converted-space"> </span><span class="" style="color: #272ad8;" data-mce-style="color: #272ad8;">0</span><span class="Apple-converted-space"> </span>{<span class="Apple-converted-space"> </span><span class="" style="color: #d12f1b;" data-mce-style="color: #d12f1b;">"Minor"</span><span class="Apple-converted-space"> </span>}<span class="Apple-converted-space"> </span><span class="" style="color: #bb2ca2;" data-mce-style="color: #bb2ca2;">else</span><span class="Apple-converted-space"> </span>{<span class="Apple-converted-space"> </span><span class="" style="color: #d12f1b;" data-mce-style="color: #d12f1b;">"None"</span><span class="Apple-converted-space"> </span>} }</div></div><div class=""><br class=""></div></div><div class="">Maybe it’s just me, but the match function feels a bit weird, in the first version.</div></div></div></blockquote><div style="font-family: 'helvetica'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="" data-mce-style="font-family: 'helvetica'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><br class=""></div><div style="font-family: 'helvetica'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="" data-mce-style="font-family: 'helvetica'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">I agree. That's why it is accompanied by the partial function closure syntax which effectively results in a switch or rather match expression.</div><div style="font-family: 'helvetica'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="" data-mce-style="font-family: 'helvetica'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><br class=""></div></blockquote></div><br class=""></div></blockquote></div></div></body></html>