[Haskell-cafe] GHC Extension Proposal: ArgumentBlock

Joachim Breitner mail at joachim-breitner.de
Mon Sep 7 12:10:27 UTC 2015


Am Sonntag, den 06.09.2015, 11:28 -0700 schrieb Andrew Gibiansky:
> 3. It does make some cases cleaner. Consider the following code: [1,
> 2, 3] ++ concat (do { .... }). This can be written with parentheses, 
> bit it cannot be written with $, because [1, 2, 3] ++ concat $ do { 
> .... } would parse as ([1, 2, 3] ++ concat) $ do { ... }. This is 
> sometimes annoying behaviour. (I used the list monad here just for 
> demo purposes. I find it is more common with applicative operators.) 

good point! This has bitten me before.

I believe that the language would be better with the proposed syntax
change being the default. So the way forward is to indeed add this
extension, see how people use it, and if Haskell' ever goes somewhere,
it might include this as the default – all alike to DoAndIfThenElse.

Also note that this does not change the meaning of any existing
program, AFAIK. So it is not that you might be reading existing code
wrongly if you are not aware that this extension is being used; you
will just find code that looks like invalid syntax to you – until you
check the list of extensions (or just deduce that ArgumentBlock is used

Therefore, +1 from me.


Joachim “nomeata” Breitner
  mail at joachim-breitner.dehttp://www.joachim-breitner.de/
  Jabber: nomeata at joachim-breitner.de  • GPG-Key: 0xF0FBF51F
  Debian Developer: nomeata at debian.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20150907/a6b68f8e/attachment.sig>

More information about the Haskell-Cafe mailing list