[Haskell-cafe] Question: Do block precedence

Matt parsonsmatt at gmail.com
Sun Feb 28 23:33:53 UTC 2016


This has come up before as 'ArgumentDo':

<goog_349057786>
mailing list thread: Proposal: ArgumentDo
<https://mail.haskell.org/pipermail/ghc-devs/2015-September/009821.html>
Relevant Phabricator ticket <https://phabricator.haskell.org/D1219>
Reddit discussion
<https://www.reddit.com/r/haskell/comments/447bnw/does_argument_do_have_a_future/>

Some people like it, though enough don't that the extension was abandoned.

Matt Parsons

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
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20160228/d11fb6cc/attachment.html>


More information about the Haskell-Cafe mailing list