runghc printing result of main when main is not IO ()
Donald Bruce Stewart
dons at cse.unsw.edu.au
Thu Aug 30 08:00:57 EDT 2007
tomasz.zielonka:
> On Thu, Aug 30, 2007 at 08:33:37AM +0100, Simon Marlow wrote:
> > 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.
>
> Great! I'm sorry for not checking with a recent version :-/
It was a cute feature though -- great for demos where you can avoid a
print statement ;)
-- Don
More information about the Glasgow-haskell-bugs
mailing list