[Haskell-cafe] Question: Do block precedence
parsonsmatt at gmail.com
Sun Feb 28 23:33:53 UTC 2016
This has come up before as 'ArgumentDo':
mailing list thread: Proposal: ArgumentDo
Relevant Phabricator ticket <https://phabricator.haskell.org/D1219>
Some people like it, though enough don't that the extension was abandoned.
On Sun, Feb 28, 2016 at 6:20 PM, Jonne Ransijn <yoyoyonny at gmail.com> wrote:
> Dear Haskell-Cafe mailing list people (?)
> I've been writing parenthesis around do blocks since forever now, but I
> don't get why they are necessary. I can't seem to come up with a program
> where they are necessary. Am I missing something or are parenthesis around
> do blocks nececairy for no reason? Since parsing 'do' blocks as if they
> have parenthesis around them doesn't seem to break any code, why not do so?
> when (doBlocksNeedParenthesis) do putStrLn "This code is invalid."
> when (doBlocksNeedParenthesis) $ do putStrLn "This code is valid."
> when (doBlocksHaveInvisibleParenthesis) do putStrLn "These are equal v"
> when (doBlocksHaveInvisibleParenthesis) (do putStrLn "These are equal
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe