<div dir="ltr">I think writing an actual comment on Github will be quite noisy. I left you a thumbs up in the “reaction” area instead.<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jul 29, 2021 at 11:11 AM Simon Peyton Jones via ghc-steering-committee <<a href="mailto:ghc-steering-committee@haskell.org">ghc-steering-committee@haskell.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div style="overflow-wrap: break-word;" lang="EN-GB">
<div class="gmail-m_6047831205920415580WordSection1">
<p class="MsoNormal">Folks<u></u><u></u></p>
<p class="MsoNormal">I’ve had a final thought about \cases.<u></u><u></u></p>
<p class="MsoNormal"><span>Looking at it now, I wonder if we can simply expand what
</span><span style="font-size:10pt;font-family:"Courier New"">LambdaCase</span><span> allows, rather than having yet another extension. That is,
</span><span style="font-size:10pt;font-family:"Courier New"">LambdaCase</span><span> now accepts
</span><span style="font-size:10pt;font-family:"Courier New"">\cases</span><span> as well as
</span><span style="font-size:10pt;font-family:"Courier New"">\case</span><span>. If we'd designed it from scratch we certainly would not have had two different extensions.<u></u><u></u></span></p>
<p class="MsoNormal"><span>The only downside I can see is a loss of back-compat in this program<u></u><u></u></span></p>
<p class="MsoNormal" style="margin:0cm"><span style="font-size:10pt;font-family:"Courier New"">{-# LANGUAGE LambdaCase #-}
<u></u><u></u></span></p>
<p class="MsoNormal" style="margin:0cm"><span style="font-size:10pt;font-family:"Courier New"">module Foo where<u></u><u></u></span></p>
<p class="MsoNormal" style="margin:0cm"><span style="font-size:10pt;font-family:"Courier New""> f = \cases -> cases + 1 -- Adds 1<u></u><u></u></span></p>
<p class="MsoNormal" style="margin:0cm"><span style="font-size:10pt;font-family:"Courier New""> g = \case { True -> False, False -> True }<u></u><u></u></span></p>
<p class="MsoNormal"><span>If we extend what LambdaCase does, the definition of
</span><span style="font-size:10pt;font-family:"Courier New"">f</span><span> will change its meaning. But this is so bizarre that I'm disinclined to waste time on it.<u></u><u></u></span></p>
<p class="MsoNormal"><span>My suggestion: expand what LambdaCase does. If not, the new extension should be LambdaCases.<u></u><u></u></span></p>
<p class="MsoNormal"><span>Can you reply on the GitHub?
<a href="https://github.com/ghc-proposals/ghc-proposals/pull/302" target="_blank">https://github.com/ghc-proposals/ghc-proposals/pull/302</a><u></u><u></u></span></p>
<p class="MsoNormal">Simon<u></u><u></u></p>
</div>
</div>
_______________________________________________<br>
ghc-steering-committee mailing list<br>
<a href="mailto:ghc-steering-committee@haskell.org" target="_blank">ghc-steering-committee@haskell.org</a><br>
<a href="https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee" rel="noreferrer" target="_blank">https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee</a><br>
</blockquote></div>