<div dir="ltr"><div>Cale's rationale chimes with me. A lot - I feel like I might have even made the same point in previous threads on this. I think of the tradeoff like this:</div><div><br></div><div>* The lack of \of doesn't really hurt very much. In fact, arguably by forcing the author to type some more characters and give something a name, we get code that's clearer for the reader. (yes this is very subjective, but syntax is).</div><div>* The addition of \of *would* hurt new users of the language. Only a bit, but every bit makes things worse, and things are already quite bad.</div><div><br></div><div>Cheers</div><div>Simon<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 3 Sep 2020 at 23:02, Richard Eisenberg <<a href="mailto:rae@richarde.dev">rae@richarde.dev</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">Hi all,<br>
<br>
Proposal #302 was submitted to the committee and assigned to Cale. He has made a recommendation on the GitHub trail, but I don't believe the committee has discussed this among ourselves.<br>
<br>
PR: <a href="https://github.com/ghc-proposals/ghc-proposals/pull/302" rel="noreferrer" target="_blank">https://github.com/ghc-proposals/ghc-proposals/pull/302</a><br>
Proposal: <a href="https://github.com/JakobBruenker/ghc-proposals/blob/patch-1/proposals/0000-lambda-layout.md" rel="noreferrer" target="_blank">https://github.com/JakobBruenker/ghc-proposals/blob/patch-1/proposals/0000-lambda-layout.md</a><br>
Cale's recommendation: <a href="https://github.com/ghc-proposals/ghc-proposals/pull/302#issuecomment-666075014" rel="noreferrer" target="_blank">https://github.com/ghc-proposals/ghc-proposals/pull/302#issuecomment-666075014</a><br>
<br>
The idea, in brief, is to introduce a new syntax (guarded behind -XMultiWayLambda) \of. Here is an example, which gives you the idea:<br>
<br>
mplus :: Maybe Int -> Maybe Int -> Maybe Int<br>
mplus = \of<br>
  Nothing _ -> Nothing<br>
  _ Nothing -> Nothing<br>
  (Just x) (Just y) -> Just (x + y)<br>
<br>
The new keyword allows us to use a syntax similar to function definitions, but without repeating the name of the function. It is also like \case, but it allows multiple arguments. Guards are allowed, as usual.<br>
<br>
I really like this new syntax -- mostly because I find it very strange that we have to repeat the function name on every line. And then change the spacing when we change the function name. And I like the mnemonic "lambda of". And it allows me to write a where clause that is accessible in multiple different patterns, or an indented where clause that is usable in just one. If it didn't confuse readers, I would use this syntax all the time.<br>
<br>
Even so, I agree with Cale's recommendation to reject. We just have too much syntax! If someone were to come along and draft a concrete proposal of how we could, for example, use this syntax to replace both \case and if|, with a migration strategy, etc., then I might be in favor. Until then, I think we've spent our budget for cute, obscure bits of syntax.<br>
<br>
Richard<br>
_______________________________________________<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>