remove instances for types/classes that are not part of Haskell
[haskell-report.git] / report / libs / System-Exit.tex
1 \haddockmoduleheading{System.Exit}
2 \label{module:System.Exit}
3 \haddockbeginheader
4 {\haddockverb\begin{verbatim}
5 module System.Exit (
6 ExitCode(ExitSuccess, ExitFailure), exitWith, exitFailure, exitSuccess
7 ) where\end{verbatim}}
8 \haddockendheader
9
10 \begin{haddockdesc}
11 \item[\begin{tabular}{@{}l}
12 data\ ExitCode
13 \end{tabular}]\haddockbegindoc
14 \haddockbeginconstrs
15 \haddockdecltt{=} & \haddockdecltt{ExitSuccess} & indicates successful termination;
16 \\
17 \haddockdecltt{|} & \haddockdecltt{ExitFailure Int} & indicates program failure with an exit code.
18 The exact interpretation of the code is
19 operating-system dependent. In particular, some values
20 may be prohibited (e.g. 0 on a POSIX-compliant system).
21 \\
22 \end{tabulary}\par
23 Defines the exit codes that a program can return.
24 \par
25
26 \end{haddockdesc}
27 \begin{haddockdesc}
28 \item[\begin{tabular}{@{}l}
29 instance\ Eq\ ExitCode\\instance\ Ord\ ExitCode\\instance\ Read\ ExitCode\\instance\ Show\ ExitCode\\
30 \end{tabular}]
31 \end{haddockdesc}
32 \begin{haddockdesc}
33 \item[\begin{tabular}{@{}l}
34 exitWith\ ::\ ExitCode\ ->\ IO\ a
35 \end{tabular}]\haddockbegindoc
36 Computation \haddocktt{exitWith\ code} terminates the program, returning \haddocktt{code}
37 to the program's caller.
38 The caller may interpret the return code as it wishes, but the program
39 should return \haddockid{ExitSuccess} to mean normal completion, and
40 \haddocktt{ExitFailure\ n} to mean that the program encountered a problem from
41 which it could not recover. The value \haddockid{exitFailure} is equal to
42 \haddocktt{exitWith\ (ExitFailure\ exitfail)}, where \haddocktt{exitfail} is
43 implementation-dependent. \haddockid{exitWith} bypasses the error handling in
44 the I/O monad and cannot be intercepted by \haddockid{catch} from the \haddocktt{Prelude}.
45 \par
46
47 \end{haddockdesc}
48 \begin{haddockdesc}
49 \item[\begin{tabular}{@{}l}
50 exitFailure\ ::\ IO\ a
51 \end{tabular}]\haddockbegindoc
52 The computation \haddockid{exitFailure} is equivalent to
53 \haddockid{exitWith} \haddocktt{(}\haddockid{ExitFailure} \emph{exitfail}\haddocktt{)},
54 where \emph{exitfail} is implementation-dependent.
55 \par
56
57 \end{haddockdesc}
58 \begin{haddockdesc}
59 \item[\begin{tabular}{@{}l}
60 exitSuccess\ ::\ IO\ a
61 \end{tabular}]\haddockbegindoc
62 The computation \haddockid{exitSuccess} is equivalent to
63 \haddockid{exitWith} \haddockid{ExitSuccess}, It terminates the program
64 sucessfully.
65 \par
66
67 \end{haddockdesc}