Use extensible exceptions at the lowest level
[ghc-base.git] / System / Exit.hs
index 1dab14f..ef19936 100644 (file)
 -----------------------------------------------------------------------------
 
 module System.Exit
-    ( 
+    (
       ExitCode(ExitSuccess,ExitFailure)
     , exitWith      -- :: ExitCode -> IO a
     , exitFailure   -- :: IO a
+    , exitSuccess   -- :: IO a
   ) where
 
 import Prelude
 
 #ifdef __GLASGOW_HASKELL__
+import GHC.Exception
 import GHC.IOBase
 #endif
 
@@ -72,3 +74,9 @@ exitWith code@(ExitFailure n)
 -- where /exitfail/ is implementation-dependent.
 exitFailure :: IO a
 exitFailure = exitWith (ExitFailure 1)
+
+-- | The computation 'exitSuccess' is equivalent to
+-- 'exitWith' 'ExitSuccess', It terminates the program
+-- sucessfully.
+exitSuccess :: IO a
+exitSuccess = exitWith ExitSuccess