ref: 4e159c62a8c00ca625d3863d65916467bb7365eb
dir: /lib/System/Exit.hs/
module System.Exit( ExitCode(..), exitWith, exitFailure, exitSuccess, die, ) where import Prelude import Control.Exception import System.IO data ExitCode = ExitSuccess | ExitFailure Int deriving (Show) -- XXX This needs work exitWith :: forall a . ExitCode -> IO a exitWith e = throwIO (Exn (show e)) exitFailure :: forall a . IO a exitFailure = exitWith (ExitFailure 1) exitSuccess :: forall a . IO a exitSuccess = exitWith ExitSuccess die :: forall a . String -> IO a die err = hPutStrLn stderr err >> exitFailure