Increase precedence of lexps (if-then-else, case-of, do, lambda and let-in)
For readability, the intro is now available here.
How it works
- Implicit parenthesis will be put around all
lexps, according to the following rules:
- Parenthesis will be opened at the start of the
- Parenthesis will be closed at the end of the
lexp. The end of the
lexpis determined by
- The curly brackets around the
lexp(If possible), or;
- The indentation of the
Basically, these are the rules Haskell already uses.
As for the Context-Free Syntax found at https://www.haskell.org/onlinereport/haskell2010/haskellch10.html\#x17-17800010.3\|layout,
lexp would have to be moved up, dropped out of
infixexp, and added into
exp (As well as a few other places in
As for my personal motivation, I think that, with all the other syntactic extensions already implemented, this feature is definitly missing.
As Richard Eisenberg already pointed out (See this comment); combining
aexp would make the Haskell syntax more consistent.
bgamari listed above argument and quite a few other pros and cons here.
A few arguments not listed there:
- If the Haskell community ever decides to implement this feature in the main language, we will already be prepared.
- Similairly, if this feature ever gives problems or adds new interesting possibilities to the language, we will be prepared.
- Yet another syntactical extension means yet another thing to look out for;
- However, this also means people will become more aware of LANGUAGE pragmas.
Here follow a few suggestions for the name of this extension:
Here are some more, taken from over here.
Examples can now be found here.
 Cheesy intro: http://pastebin.com/8Fsh7pAE
 Original examples: http://pastebin.com/6kLQvKs9
 Pros and Cons: https://ghc.haskell.org/trac/ghc/ticket/10843#comment:12
 ArgumentBlock proposal: https://mail.haskell.org/pipermail/haskell-cafe/2015-September/121217.html