Sophie

Sophie

distrib > Mageia > 5 > i586 > media > core-release > by-pkgid > 6e204a966e8c42d976f99a1700ce5f20 > files > 2323

ghc-7.4.2-4.mga5.i586.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>System.Exit</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_System-Exit.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">base-4.5.1.0: Basic libraries</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Portability</th><td>portable</td></tr><tr><th>Stability</th><td>provisional</td></tr><tr><th>Maintainer</th><td>libraries@haskell.org</td></tr><tr><th>Safe Haskell</th><td>Trustworthy</td></tr></table><p class="caption">System.Exit</p></div><div id="description"><p class="caption">Description</p><div class="doc"><p>Exiting the program.
</p></div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><span class="keyword">data</span>  <a href="#t:ExitCode">ExitCode</a> <ul class="subs"><li>= <a href="#v:ExitSuccess">ExitSuccess</a>  </li><li>| <a href="#v:ExitFailure">ExitFailure</a> <a href="Data-Int.html#t:Int">Int</a>  </li></ul></li><li class="src short"><a href="#v:exitWith">exitWith</a> ::  <a href="System-Exit.html#t:ExitCode">ExitCode</a> -&gt; <a href="System-IO.html#t:IO">IO</a> a</li><li class="src short"><a href="#v:exitFailure">exitFailure</a> ::  <a href="System-IO.html#t:IO">IO</a> a</li><li class="src short"><a href="#v:exitSuccess">exitSuccess</a> ::  <a href="System-IO.html#t:IO">IO</a> a</li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><span class="keyword">data</span>  <a name="t:ExitCode" class="def">ExitCode</a>  </p><div class="doc"><p>Defines the exit codes that a program can return.
</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:ExitSuccess" class="def">ExitSuccess</a></td><td class="doc"><p>indicates successful termination;
</p></td></tr><tr><td class="src"><a name="v:ExitFailure" class="def">ExitFailure</a> <a href="Data-Int.html#t:Int">Int</a></td><td class="doc"><p>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).
</p></td></tr></table></div><div class="subs instances"><p id="control.i:ExitCode" class="caption collapser" onclick="toggleSection('i:ExitCode')">Instances</p><div id="section.i:ExitCode" class="show"><table><tr><td class="src"><a href="Data-Eq.html#t:Eq">Eq</a> <a href="System-Exit.html#t:ExitCode">ExitCode</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="Data-Ord.html#t:Ord">Ord</a> <a href="System-Exit.html#t:ExitCode">ExitCode</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="Text-Read.html#t:Read">Read</a> <a href="System-Exit.html#t:ExitCode">ExitCode</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="Text-Show.html#t:Show">Show</a> <a href="System-Exit.html#t:ExitCode">ExitCode</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="Data-Typeable-Internal.html#t:Typeable">Typeable</a> <a href="System-Exit.html#t:ExitCode">ExitCode</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="Control-Exception-Base.html#t:Exception">Exception</a> <a href="System-Exit.html#t:ExitCode">ExitCode</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:exitWith" class="def">exitWith</a> ::  <a href="System-Exit.html#t:ExitCode">ExitCode</a> -&gt; <a href="System-IO.html#t:IO">IO</a> a</p><div class="doc"><p>Computation <code><a href="System-Exit.html#v:exitWith">exitWith</a></code> <code>code</code> throws <code><a href="System-Exit.html#t:ExitCode">ExitCode</a></code> <code>code</code>.
 Normally this terminates the program, returning <code>code</code> to the
 program's caller.
</p><p>On program termination, the standard <code>Handle</code>s <code>stdout</code> and
 <code>stderr</code> are flushed automatically; any other buffered <code>Handle</code>s
 need to be flushed manually, otherwise the buffered data will be
 discarded.
</p><p>A program that fails in any other way is treated as if it had
 called <code><a href="System-Exit.html#v:exitFailure">exitFailure</a></code>.
 A program that terminates successfully without calling <code><a href="System-Exit.html#v:exitWith">exitWith</a></code>
 explicitly is treated as it it had called <code><a href="System-Exit.html#v:exitWith">exitWith</a></code> <code><a href="System-Exit.html#v:ExitSuccess">ExitSuccess</a></code>.
</p><p>As an <code><a href="System-Exit.html#t:ExitCode">ExitCode</a></code> is not an <code><a href="System-IO-Error.html#t:IOError">IOError</a></code>, <code><a href="System-Exit.html#v:exitWith">exitWith</a></code> bypasses
 the error handling in the <code><a href="System-IO.html#t:IO">IO</a></code> monad and cannot be intercepted by
 <code><a href="System-IO-Error.html#v:catch">catch</a></code> from the <a href="Prelude.html">Prelude</a>.  However it is a <code>SomeException</code>, and can
 be caught using the functions of <a href="Control-Exception.html">Control.Exception</a>.  This means
 that cleanup computations added with <code><a href="Control-Exception.html#v:bracket">bracket</a></code>
 (from <a href="Control-Exception.html">Control.Exception</a>) are also executed properly on <code><a href="System-Exit.html#v:exitWith">exitWith</a></code>.
</p><p>Note: in GHC, <code><a href="System-Exit.html#v:exitWith">exitWith</a></code> should be called from the main program
 thread in order to exit the process.  When called from another
 thread, <code><a href="System-Exit.html#v:exitWith">exitWith</a></code> will throw an <code>ExitException</code> as normal, but the
 exception will not cause the process itself to exit.
</p></div></div><div class="top"><p class="src"><a name="v:exitFailure" class="def">exitFailure</a> ::  <a href="System-IO.html#t:IO">IO</a> a</p><div class="doc"><p>The computation <code><a href="System-Exit.html#v:exitFailure">exitFailure</a></code> is equivalent to
 <code><a href="System-Exit.html#v:exitWith">exitWith</a></code> <code>(</code><code><a href="System-Exit.html#v:ExitFailure">ExitFailure</a></code> <em>exitfail</em><code>)</code>,
 where <em>exitfail</em> is implementation-dependent.
</p></div></div><div class="top"><p class="src"><a name="v:exitSuccess" class="def">exitSuccess</a> ::  <a href="System-IO.html#t:IO">IO</a> a</p><div class="doc"><p>The computation <code><a href="System-Exit.html#v:exitSuccess">exitSuccess</a></code> is equivalent to
 <code><a href="System-Exit.html#v:exitWith">exitWith</a></code> <code><a href="System-Exit.html#v:ExitSuccess">ExitSuccess</a></code>, It terminates the program
 successfully.
</p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.11.0</p></div></body></html>