summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorSimon Marlow <simonmar@microsoft.com>2007-03-13 14:46:14 +0000
committerSimon Marlow <simonmar@microsoft.com>2007-03-13 14:46:14 +0000
commit246250d7bd57de6645c13d2e1d1525c583a9d509 (patch)
treec743b16a7937ed82fbea733dae0a13e602e56ad9 /utils
parent7979153412d385545e9a43e1bb65419028cfec88 (diff)
downloadhaskell-246250d7bd57de6645c13d2e1d1525c583a9d509.tar.gz
fix #1200: don't evaluate the result of main
Diffstat (limited to 'utils')
-rw-r--r--utils/runghc/runghc.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/utils/runghc/runghc.hs b/utils/runghc/runghc.hs
index 83163bd401..cdf06dc33f 100644
--- a/utils/runghc/runghc.hs
+++ b/utils/runghc/runghc.hs
@@ -58,13 +58,17 @@ doIt ghc args = do
"-ignore-dot-ghci" : ghc_args ++
[ "-e","System.Environment.withProgName "++show filename++" (System.Environment.withArgs ["
++ concat (intersperse "," (map show prog_args))
- ++ "] (GHC.TopHandler.runIOFastExit Main.main))", filename])
+ ++ "] (GHC.TopHandler.runIOFastExit (Main.main Prelude.>> (Prelude.return ()))))", filename])
-- runIOFastExit: makes exceptions raised by Main.main
-- behave in the same way as for a compiled program.
-- The "fast exit" part just calls exit() directly
-- instead of doing an orderly runtime shutdown,
-- otherwise the main GHCi thread will complain about
-- being interrupted.
+ --
+ -- Why (main >> return ()) rather than just main? Because
+ -- otherwise GHCi by default tries to evaluate the result
+ -- of the IO in order to show it (see #1200).
exitWith res
notArg ('-':_) = False