Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Synopsis
- data ExitCode
- exitWith :: ExitCode -> IO a
- exitFailure :: IO a
- exitSuccess :: IO a
Documentation
Defines the exit codes that a program can return.
ExitSuccess | indicates successful termination; |
ExitFailure Int | indicates program failure with an exit code. The exact interpretation of the code is operating-system dependent. In particular, some values may be prohibited (e.g. 0 on a POSIX-compliant system). |
Instances
Eq ExitCode | |
Ord ExitCode | |
Defined in GHC.IO.Exception | |
Read ExitCode | |
Show ExitCode | |
Generic ExitCode | |
Exception ExitCode | Since: base-4.1.0.0 |
Defined in GHC.IO.Exception toException :: ExitCode -> SomeException # fromException :: SomeException -> Maybe ExitCode # displayException :: ExitCode -> String # | |
type Rep ExitCode | |
Defined in GHC.IO.Exception |
exitWith :: ExitCode -> IO a Source #
Computation
terminates the program, returning exitWith
codecode
to the program's caller.
The caller may interpret the return code as it wishes, but the program
should return ExitSuccess
to mean normal completion, and
to mean that the program encountered a problem from
which it could not recover. The value ExitFailure
nexitFailure
is equal to
, where exitWith
(ExitFailure
exitfail)exitfail
is
implementation-dependent. exitWith
bypasses the error handling in
the I/O monad and cannot be intercepted by catch
from the Prelude
.
exitFailure :: IO a #
The computation exitFailure
is equivalent to
exitWith
(
ExitFailure
exitfail)
,
where exitfail is implementation-dependent.
exitSuccess :: IO a #
The computation exitSuccess
is equivalent to
exitWith
ExitSuccess
, It terminates the program
successfully.