Sophie

Sophie

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

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</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.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">haskell98-2.0.0.1: Compatibility with Haskell 98</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Safe Haskell</th><td>Trustworthy</td></tr></table><p class="caption">System</p></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="Prelude.html#t:Int">Int</a>  </li></ul></li><li class="src short"><a href="#v:getArgs">getArgs</a> :: <a href="Prelude.html#t:IO">IO</a> [<a href="Prelude.html#t:String">String</a>]</li><li class="src short"><a href="#v:getProgName">getProgName</a> :: <a href="Prelude.html#t:IO">IO</a> <a href="Prelude.html#t:String">String</a></li><li class="src short"><a href="#v:getEnv">getEnv</a> :: <a href="Prelude.html#t:String">String</a> -&gt; <a href="Prelude.html#t:IO">IO</a> <a href="Prelude.html#t:String">String</a></li><li class="src short"><a href="#v:system">system</a> :: <a href="Prelude.html#t:String">String</a> -&gt; <a href="Prelude.html#t:IO">IO</a> <a href="System.html#t:ExitCode">ExitCode</a></li><li class="src short"><a href="#v:exitWith">exitWith</a> ::  <a href="System.html#t:ExitCode">ExitCode</a> -&gt; <a href="Prelude.html#t:IO">IO</a> a</li><li class="src short"><a href="#v:exitFailure">exitFailure</a> ::  <a href="Prelude.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>  <a href="../base-4.5.1.0/src/GHC-IO-Exception.html#ExitCode" class="link">Source</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="Prelude.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="Prelude.html#t:Eq">Eq</a> <a href="System.html#t:ExitCode">ExitCode</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="Prelude.html#t:Ord">Ord</a> <a href="System.html#t:ExitCode">ExitCode</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="Prelude.html#t:Read">Read</a> <a href="System.html#t:ExitCode">ExitCode</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="Prelude.html#t:Show">Show</a> <a href="System.html#t:ExitCode">ExitCode</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="../base-4.5.1.0/Data-Typeable-Internal.html#t:Typeable">Typeable</a> <a href="System.html#t:ExitCode">ExitCode</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="../base-4.5.1.0/Control-Exception-Base.html#t:Exception">Exception</a> <a href="System.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:getArgs" class="def">getArgs</a> :: <a href="Prelude.html#t:IO">IO</a> [<a href="Prelude.html#t:String">String</a>]<a href="../base-4.5.1.0/src/System-Environment.html#getArgs" class="link">Source</a></p><div class="doc"><p>Computation <code><a href="System.html#v:getArgs">getArgs</a></code> returns a list of the program's command
 line arguments (not including the program name).
</p></div></div><div class="top"><p class="src"><a name="v:getProgName" class="def">getProgName</a> :: <a href="Prelude.html#t:IO">IO</a> <a href="Prelude.html#t:String">String</a><a href="../base-4.5.1.0/src/System-Environment.html#getProgName" class="link">Source</a></p><div class="doc"><p>Computation <code><a href="System.html#v:getProgName">getProgName</a></code> returns the name of the program as it was
invoked.
</p><p>However, this is hard-to-impossible to implement on some non-Unix
OSes, so instead, for maximum portability, we just return the leafname
of the program as invoked. Even then there are some differences
between platforms: on Windows, for example, a program invoked as foo
is probably really <code>FOO.EXE</code>, and that is what <code><a href="System.html#v:getProgName">getProgName</a></code> will return.
</p></div></div><div class="top"><p class="src"><a name="v:getEnv" class="def">getEnv</a> :: <a href="Prelude.html#t:String">String</a> -&gt; <a href="Prelude.html#t:IO">IO</a> <a href="Prelude.html#t:String">String</a><a href="../base-4.5.1.0/src/System-Environment.html#getEnv" class="link">Source</a></p><div class="doc"><p>Computation <code><a href="System.html#v:getEnv">getEnv</a></code> <code>var</code> returns the value
 of the environment variable <code>var</code>.  
</p><p>This computation may fail with:
</p><ul><li> <code><a href="../base-4.5.1.0/System-IO-Error.html#v:isDoesNotExistError">isDoesNotExistError</a></code> if the environment variable
    does not exist.
</li></ul></div></div><div class="top"><p class="src"><a name="v:system" class="def">system</a> :: <a href="Prelude.html#t:String">String</a> -&gt; <a href="Prelude.html#t:IO">IO</a> <a href="System.html#t:ExitCode">ExitCode</a><a href="../process-1.1.0.1/src/System-Process.html#system" class="link">Source</a></p><div class="doc"><p>Computation <code>system cmd</code> returns the exit code produced when the
operating system runs the shell command <code>cmd</code>.
</p><p>This computation may fail with
</p><ul><li> <code>PermissionDenied</code>: The process has insufficient privileges to
     perform the operation.
</li><li> <code>ResourceExhausted</code>: Insufficient resources are available to
     perform the operation.
</li><li> <code>UnsupportedOperation</code>: The implementation does not support
     system calls.
</li></ul><p>On Windows, <code><a href="System.html#v:system">system</a></code> passes the command to the Windows command
interpreter (<code>CMD.EXE</code> or <code>COMMAND.COM</code>), hence Unixy shell tricks
will not work.
</p></div></div><div class="top"><p class="src"><a name="v:exitWith" class="def">exitWith</a> ::  <a href="System.html#t:ExitCode">ExitCode</a> -&gt; <a href="Prelude.html#t:IO">IO</a> a<a href="../base-4.5.1.0/src/System-Exit.html#exitWith" class="link">Source</a></p><div class="doc"><p>Computation <code><a href="System.html#v:exitWith">exitWith</a></code> <code>code</code> throws <code><a href="System.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.html#v:exitFailure">exitFailure</a></code>.
 A program that terminates successfully without calling <code><a href="System.html#v:exitWith">exitWith</a></code>
 explicitly is treated as it it had called <code><a href="System.html#v:exitWith">exitWith</a></code> <code><a href="System.html#v:ExitSuccess">ExitSuccess</a></code>.
</p><p>As an <code><a href="System.html#t:ExitCode">ExitCode</a></code> is not an <code><a href="Prelude.html#t:IOError">IOError</a></code>, <code><a href="System.html#v:exitWith">exitWith</a></code> bypasses
 the error handling in the <code><a href="Prelude.html#t:IO">IO</a></code> monad and cannot be intercepted by
 <code><a href="../base-4.5.1.0/System-IO-Error.html#v:catch">catch</a></code> from the <a href="../base-4.5.1.0/Prelude.html">Prelude</a>.  However it is a <code>SomeException</code>, and can
 be caught using the functions of <a href="../base-4.5.1.0/Control-Exception.html">Control.Exception</a>.  This means
 that cleanup computations added with <code><a href="../base-4.5.1.0/Control-Exception.html#v:bracket">bracket</a></code>
 (from <a href="../base-4.5.1.0/Control-Exception.html">Control.Exception</a>) are also executed properly on <code><a href="System.html#v:exitWith">exitWith</a></code>.
</p><p>Note: in GHC, <code><a href="System.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.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="Prelude.html#t:IO">IO</a> a<a href="../base-4.5.1.0/src/System-Exit.html#exitFailure" class="link">Source</a></p><div class="doc"><p>The computation <code><a href="System.html#v:exitFailure">exitFailure</a></code> is equivalent to
 <code><a href="System.html#v:exitWith">exitWith</a></code> <code>(</code><code><a href="System.html#v:ExitFailure">ExitFailure</a></code> <em>exitfail</em><code>)</code>,
 where <em>exitfail</em> is implementation-dependent.
</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>