[project @ 2003-08-04 18:20:44 by panne]
[ghc-base.git] / System / Exit.hs
index 23bfbdb..bce69e6 100644 (file)
@@ -27,6 +27,7 @@ import GHC.IOBase
 
 #ifdef __HUGS__
 import Hugs.Prelude
+import Hugs.Exception
 #endif
 
 #ifdef __NHC__
@@ -45,9 +46,9 @@ import System
 
 #ifndef __NHC__
 exitWith :: ExitCode -> IO a
-exitWith ExitSuccess = throw (ExitException ExitSuccess)
+exitWith ExitSuccess = throwIO (ExitException ExitSuccess)
 exitWith code@(ExitFailure n)
-  | n /= 0 = throw (ExitException code)
+  | n /= 0 = throwIO (ExitException code)
 #ifdef __GLASGOW_HASKELL__
   | otherwise = ioError (IOError Nothing InvalidArgument "exitWith" "ExitFailure 0" Nothing)
 #endif