[project @ 2002-02-05 15:42:04 by simonpj]
[ghc-hetmet.git] / ghc / lib / std / PrelTopHandler.hs
index 1159631..9773728 100644 (file)
@@ -20,7 +20,7 @@
 -- Note: used to be called PrelTopHandler.lhs, so if you're looking
 --       for CVS info, try 'cvs log'ging it too.
 module PrelTopHandler (
-   topHandler, reportStackOverflow, reportError 
+   runMain, reportStackOverflow, reportError 
   ) where
 
 import IO
@@ -30,6 +30,10 @@ import PrelPtr
 import PrelIOBase
 import PrelException
 
+-- runMain is applied to Main.main by TcModule
+runMain :: IO a -> IO ()
+runMain main = catchException (main >> return ()) topHandler
+
 topHandler :: Exception -> IO ()
 topHandler err = catchException (real_handler err) topHandler