[Haskell-cafe] GHC Extension Proposal: ArgumentBlock

Bardur Arantsson spam at scientician.net
Mon Sep 7 05:39:19 UTC 2015


(Please don't top-post... and please don't quote all of the previous
message unless you really need to  It breaks the flow of conversation.)

On 09/07/2015 01:43 AM, Tikhon Jelvis wrote:
> +1 from me. At a high level, one of the things that attracts me to Haskell
> over other languages is that it's willing to change and improve at a faster
> rate (although, in absolute terms, it's still pretty slow and concerned
> about backwards compatibility). Assuming a tweak makes sense, rolling it
> out as an extension and then folding it into the language (maybe as part of
> the mythical Haskell 2020 standard :)) is perfect. DoAndIfThenElse is a
> reasonable point of comparison and seems to be a good deal.

Haskell keeps evolving at a brisk pace, see the depenently typed stuff
that's coming up, etc.

I question the value of constantly changing the *syntax*, which is
mostly a triviality. The other syntactic extensions that we brought up
saved a lot more than one character, btw!

> 
> And I *do* think this tweak makes sense. The new behavior is more inline
> with my expectations. I feel that do and lambdas are self-contained
> expressions and inherently group their contents together; needing an extra
> set of parentheses or a $ does not make sense. A good way to think about it
> is that I see do as having braces semantically even when they're
> syntactically optional. I think most people would agree that requiring
> parentheses aroud
> 
>     foo (do { x; y; z })
> 
> is redundant and not useful.
> 

So what would you write if foo were changed to take two arguments?

      foo (do { x; y; z }) (do { a; b; c })

See... no surprises!

Regards,




More information about the Haskell-Cafe mailing list