<div dir="ltr">Possible future suggestion: Add a `InlineStatements` language pragma which puts implicit parenthesis around `if-then-else`, `case-of` and `do` blocks,<div><br></div><div>See: <a href="http://pastebin.com/T7L6GyBu">http://pastebin.com/T7L6GyBu</a> (Permanent pastebin)</div><div>for a example program.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 29, 2016 at 1:22 AM, Thomas Tuegel <span dir="ltr"><<a href="mailto:ttuegel@gmail.com" target="_blank">ttuegel@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Sun, Feb 28, 2016 at 5:20 PM, Jonne Ransijn <<a href="mailto:yoyoyonny@gmail.com">yoyoyonny@gmail.com</a>> wrote:<br>
> Dear Haskell-Cafe mailing list people (?)<br>
> I've been writing parenthesis around do blocks since forever now, but I<br>
> don't get why they are necessary. I can't seem to come up with a program<br>
> where they are necessary. Am I missing something or are parenthesis around<br>
> do blocks nececairy for no reason? Since parsing 'do' blocks as if they have<br>
> parenthesis around them doesn't seem to break any code, why not do so?<br>
><br>
> when (doBlocksNeedParenthesis) do putStrLn "This code is invalid."<br>
><br>
> when (doBlocksNeedParenthesis) $ do putStrLn "This code is valid."<br>
><br>
> when (doBlocksHaveInvisibleParenthesis) do putStrLn "These are equal v"<br>
><br>
> when (doBlocksHaveInvisibleParenthesis) (do putStrLn "These are equal<br>
> ^")<br>
<br>
This syntax can be ambiguous; consider:<br>
<br>
> (flip when) do putStrLn "Where do the parentheses go?" True<br>
<br>
I admit this is contrived; we could choose to put parentheses around a<br>
do-block only if it is the terminal argument. There is a case that is<br>
completely unambiguous:<br>
<br>
> (flip when) do { putStrLn "Braces might as well be parentheses." } True<br>
<br>
Certainly, I don't see why this shouldn't parse.<br>
<br>
Regards,<br>
Tom<br>
</blockquote></div><br></div>