Proposal: Argument Do

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


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 <>.
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: <>

More information about the ghc-devs mailing list