runghc printing result of main when main is not IO ()

Simon Marlow simonmarhaskell at gmail.com
Thu Aug 30 03:33:37 EDT 2007


Tomasz Zielonka wrote:
> Hello!
> 
> Consider:
> 
> $ cat R.hs 
> main = return [()]
> $ runghc R.hs 
> [()]
> 
> This was a bit surprising for me, because I thought that runghc
> mimics the way a compiled program behaves.

This doesn't happen with 6.6.1, I believe we fixed it at some point by 
having runghc perform "main >> return ()" instead of just main.

Cheers,
	Simon


More information about the Glasgow-haskell-bugs mailing list