Proposal: Argument Do

Andrew Gibiansky andrew.gibiansky at gmail.com
Sat Sep 5 08:39:02 UTC 2015


Trac: https://ghc.haskell.org/trac/ghc/ticket/10843

I would like the following to be valid Haskell code:

main = when True do
  putStrLn "Hello!"

Instead of requiring a dollar sign before the "do". This would parse as

main = when True (do
  putStrLn "Hello!")


Has this been tried before? It seems fairly simple -- is there some
complexity I'm missing? I've always been confused as to why the parser
requires `$` there, and I've heard a lot of others ask about this as
well. Perhaps we could fix that?


PS. Regardless of whether this goes anywhere, it was fun to learn how
to hack on GHC. It was surprisingly easy; I wrote up my experience
here <http://rawgit.com/gibiansky/4c54f767bf21a6954b23/raw/67c62c5555f40c6fb67b124307725df168201361/exp.html>.
The GHC wiki is outstanding; pretty much every intro question about
ghc development I had was answered on a fairly easy-to-find wiki age.
(Except for some stuff related to generating documentation and
docbook, but whatever.)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20150905/f51b2051/attachment.html>


More information about the ghc-devs mailing list