Sophie

Sophie

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

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>Distribution.Simple.Program.Types</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_Distribution-Simple-Program-Types.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">Cabal-1.14.0: A framework for packaging Haskell software</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Portability</th><td>portable</td></tr><tr><th>Maintainer</th><td>cabal-devel@haskell.org</td></tr><tr><th>Safe Haskell</th><td>None</td></tr></table><p class="caption">Distribution.Simple.Program.Types</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Program and functions for constructing them
</a></li><li><a href="#g:2">Configured program and related functions
</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>This provides an abstraction which deals with configuring and running
 programs. A <code><a href="Distribution-Simple-Program-Types.html#t:Program">Program</a></code> is a static notion of a known program. A
 <code><a href="Distribution-Simple-Program-Types.html#t:ConfiguredProgram">ConfiguredProgram</a></code> is a <code><a href="Distribution-Simple-Program-Types.html#t:Program">Program</a></code> that has been found on the current
 machine and is ready to be run (possibly with some user-supplied default
 args). Configuring a program involves finding its location and if necessary
 finding its version. There's reasonable default behavior for trying to find
 &quot;foo&quot; in PATH, being able to override its location, etc.
</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:Program">Program</a>  = <a href="#v:Program">Program</a> {<ul class="subs"><li><a href="#v:programName">programName</a> :: <a href="../base-4.5.1.0/Data-String.html#t:String">String</a></li><li><a href="#v:programFindLocation">programFindLocation</a> :: <a href="Distribution-Verbosity.html#t:Verbosity">Verbosity</a> -&gt; <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> (<a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a>)</li><li><a href="#v:programFindVersion">programFindVersion</a> :: <a href="Distribution-Verbosity.html#t:Verbosity">Verbosity</a> -&gt; <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -&gt; <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> (<a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Distribution-Version.html#t:Version">Version</a>)</li><li><a href="#v:programPostConf">programPostConf</a> :: <a href="Distribution-Verbosity.html#t:Verbosity">Verbosity</a> -&gt; <a href="Distribution-Simple-Program-Types.html#t:ConfiguredProgram">ConfiguredProgram</a> -&gt; <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> [<a href="Distribution-Simple-Program-Types.html#t:ProgArg">ProgArg</a>]</li></ul>}</li><li class="src short"><a href="#v:simpleProgram">simpleProgram</a> :: <a href="../base-4.5.1.0/Data-String.html#t:String">String</a> -&gt; <a href="Distribution-Simple-Program-Types.html#t:Program">Program</a></li><li class="src short"><span class="keyword">data</span>  <a href="#t:ConfiguredProgram">ConfiguredProgram</a>  = <a href="#v:ConfiguredProgram">ConfiguredProgram</a> {<ul class="subs"><li><a href="#v:programId">programId</a> :: <a href="../base-4.5.1.0/Data-String.html#t:String">String</a></li><li><a href="#v:programVersion">programVersion</a> :: <a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Distribution-Version.html#t:Version">Version</a></li><li><a href="#v:programDefaultArgs">programDefaultArgs</a> :: [<a href="../base-4.5.1.0/Data-String.html#t:String">String</a>]</li><li><a href="#v:programOverrideArgs">programOverrideArgs</a> :: [<a href="../base-4.5.1.0/Data-String.html#t:String">String</a>]</li><li><a href="#v:programLocation">programLocation</a> :: <a href="Distribution-Simple-Program-Types.html#t:ProgramLocation">ProgramLocation</a></li></ul>}</li><li class="src short"><a href="#v:programPath">programPath</a> :: <a href="Distribution-Simple-Program-Types.html#t:ConfiguredProgram">ConfiguredProgram</a> -&gt; <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a></li><li class="src short"><span class="keyword">type</span> <a href="#t:ProgArg">ProgArg</a> = <a href="../base-4.5.1.0/Data-String.html#t:String">String</a></li><li class="src short"><span class="keyword">data</span>  <a href="#t:ProgramLocation">ProgramLocation</a> <ul class="subs"><li>= <a href="#v:UserSpecified">UserSpecified</a> { <ul class="subs"><li><a href="#v:locationPath">locationPath</a> :: <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a></li></ul> }</li><li>| <a href="#v:FoundOnSystem">FoundOnSystem</a> { <ul class="subs"><li><a href="#v:locationPath">locationPath</a> :: <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a></li></ul> }</li></ul></li><li class="src short"><a href="#v:simpleConfiguredProgram">simpleConfiguredProgram</a> :: <a href="../base-4.5.1.0/Data-String.html#t:String">String</a> -&gt; <a href="Distribution-Simple-Program-Types.html#t:ProgramLocation">ProgramLocation</a> -&gt; <a href="Distribution-Simple-Program-Types.html#t:ConfiguredProgram">ConfiguredProgram</a></li></ul></div><div id="interface"><h1 id="g:1">Program and functions for constructing them
</h1><div class="top"><p class="src"><span class="keyword">data</span>  <a name="t:Program" class="def">Program</a>  </p><div class="doc"><p>Represents a program which can be configured.
</p><p>Note: rather than constructing this directly, start with <code><a href="Distribution-Simple-Program-Types.html#v:simpleProgram">simpleProgram</a></code> and
 override any extra fields.
</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:Program" class="def">Program</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><dl><dt class="src"><a name="v:programName" class="def">programName</a> :: <a href="../base-4.5.1.0/Data-String.html#t:String">String</a></dt><dd class="doc"><p>The simple name of the program, eg. ghc
</p></dd><dt class="src"><a name="v:programFindLocation" class="def">programFindLocation</a> :: <a href="Distribution-Verbosity.html#t:Verbosity">Verbosity</a> -&gt; <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> (<a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a>)</dt><dd class="doc"><p>A function to search for the program if it's location was not
 specified by the user. Usually this will just be a
</p></dd><dt class="src"><a name="v:programFindVersion" class="def">programFindVersion</a> :: <a href="Distribution-Verbosity.html#t:Verbosity">Verbosity</a> -&gt; <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a> -&gt; <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> (<a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Distribution-Version.html#t:Version">Version</a>)</dt><dd class="doc"><p>Try to find the version of the program. For many programs this is
 not possible or is not necessary so it's ok to return Nothing.
</p></dd><dt class="src"><a name="v:programPostConf" class="def">programPostConf</a> :: <a href="Distribution-Verbosity.html#t:Verbosity">Verbosity</a> -&gt; <a href="Distribution-Simple-Program-Types.html#t:ConfiguredProgram">ConfiguredProgram</a> -&gt; <a href="../base-4.5.1.0/System-IO.html#t:IO">IO</a> [<a href="Distribution-Simple-Program-Types.html#t:ProgArg">ProgArg</a>]</dt><dd class="doc"><p>A function to do any additional configuration after we have
 located the program (and perhaps identified its version). It is
 allowed to return additional flags that will be passed to the
 program on every invocation.
</p></dd></dl><div class="clear"></div></div></td></tr></table></div></div><div class="top"><p class="src"><a name="v:simpleProgram" class="def">simpleProgram</a> :: <a href="../base-4.5.1.0/Data-String.html#t:String">String</a> -&gt; <a href="Distribution-Simple-Program-Types.html#t:Program">Program</a></p><div class="doc"><p>Make a simple named program.
</p><p>By default we'll just search for it in the path and not try to find the
 version name. You can override these behaviours if necessary, eg:
</p><pre> simpleProgram &quot;foo&quot; { programFindLocation = ... , programFindVersion ... }
</pre></div></div><h1 id="g:2">Configured program and related functions
</h1><div class="top"><p class="src"><span class="keyword">data</span>  <a name="t:ConfiguredProgram" class="def">ConfiguredProgram</a>  </p><div class="doc"><p>Represents a program which has been configured and is thus ready to be run.
</p><p>These are usually made by configuring a <code><a href="Distribution-Simple-Program-Types.html#t:Program">Program</a></code>, but if you have to
 construct one directly then start with <code><a href="Distribution-Simple-Program-Types.html#v:simpleConfiguredProgram">simpleConfiguredProgram</a></code> and
 override any extra fields.
</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:ConfiguredProgram" class="def">ConfiguredProgram</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><dl><dt class="src"><a name="v:programId" class="def">programId</a> :: <a href="../base-4.5.1.0/Data-String.html#t:String">String</a></dt><dd class="doc"><p>Just the name again
</p></dd><dt class="src"><a name="v:programVersion" class="def">programVersion</a> :: <a href="../base-4.5.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Distribution-Version.html#t:Version">Version</a></dt><dd class="doc"><p>The version of this program, if it is known.
</p></dd><dt class="src"><a name="v:programDefaultArgs" class="def">programDefaultArgs</a> :: [<a href="../base-4.5.1.0/Data-String.html#t:String">String</a>]</dt><dd class="doc"><p>Default command-line args for this program.
 These flags will appear first on the command line, so they can be
 overridden by subsequent flags.
</p></dd><dt class="src"><a name="v:programOverrideArgs" class="def">programOverrideArgs</a> :: [<a href="../base-4.5.1.0/Data-String.html#t:String">String</a>]</dt><dd class="doc"><p>Override command-line args for this program.
 These flags will appear last on the command line, so they override
 all earlier flags.
</p></dd><dt class="src"><a name="v:programLocation" class="def">programLocation</a> :: <a href="Distribution-Simple-Program-Types.html#t:ProgramLocation">ProgramLocation</a></dt><dd class="doc"><p>Location of the program. eg. <code>/usr/bin/ghc-6.4</code>
</p></dd></dl><div class="clear"></div></div></td></tr></table></div><div class="subs instances"><p id="control.i:ConfiguredProgram" class="caption collapser" onclick="toggleSection('i:ConfiguredProgram')">Instances</p><div id="section.i:ConfiguredProgram" class="show"><table><tr><td class="src"><a href="../base-4.5.1.0/Data-Eq.html#t:Eq">Eq</a> <a href="Distribution-Simple-Program-Types.html#t:ConfiguredProgram">ConfiguredProgram</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="../base-4.5.1.0/Text-Read.html#t:Read">Read</a> <a href="Distribution-Simple-Program-Types.html#t:ConfiguredProgram">ConfiguredProgram</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="../base-4.5.1.0/Text-Show.html#t:Show">Show</a> <a href="Distribution-Simple-Program-Types.html#t:ConfiguredProgram">ConfiguredProgram</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:programPath" class="def">programPath</a> :: <a href="Distribution-Simple-Program-Types.html#t:ConfiguredProgram">ConfiguredProgram</a> -&gt; <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a></p><div class="doc"><p>The full path of a configured program.
</p></div></div><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:ProgArg" class="def">ProgArg</a> = <a href="../base-4.5.1.0/Data-String.html#t:String">String</a></p></div><div class="top"><p class="src"><span class="keyword">data</span>  <a name="t:ProgramLocation" class="def">ProgramLocation</a>  </p><div class="doc"><p>Where a program was found. Also tells us whether it's specifed by user or
 not.  This includes not just the path, but the program as well.
</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:UserSpecified" class="def">UserSpecified</a></td><td class="doc"><p>The user gave the path to this program,
 eg. --ghc-path=/usr/bin/ghc-6.6
</p></td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><dl><dt class="src"><a name="v:locationPath" class="def">locationPath</a> :: <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a></dt><dd class="doc empty">&nbsp;</dd></dl><div class="clear"></div></div></td></tr><tr><td class="src"><a name="v:FoundOnSystem" class="def">FoundOnSystem</a></td><td class="doc"><p>The program was found automatically.
</p></td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><dl><dt class="src"><a name="v:locationPath" class="def">locationPath</a> :: <a href="../base-4.5.1.0/System-IO.html#t:FilePath">FilePath</a></dt><dd class="doc empty">&nbsp;</dd></dl><div class="clear"></div></div></td></tr></table></div><div class="subs instances"><p id="control.i:ProgramLocation" class="caption collapser" onclick="toggleSection('i:ProgramLocation')">Instances</p><div id="section.i:ProgramLocation" class="show"><table><tr><td class="src"><a href="../base-4.5.1.0/Data-Eq.html#t:Eq">Eq</a> <a href="Distribution-Simple-Program-Types.html#t:ProgramLocation">ProgramLocation</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="../base-4.5.1.0/Text-Read.html#t:Read">Read</a> <a href="Distribution-Simple-Program-Types.html#t:ProgramLocation">ProgramLocation</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="../base-4.5.1.0/Text-Show.html#t:Show">Show</a> <a href="Distribution-Simple-Program-Types.html#t:ProgramLocation">ProgramLocation</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:simpleConfiguredProgram" class="def">simpleConfiguredProgram</a> :: <a href="../base-4.5.1.0/Data-String.html#t:String">String</a> -&gt; <a href="Distribution-Simple-Program-Types.html#t:ProgramLocation">ProgramLocation</a> -&gt; <a href="Distribution-Simple-Program-Types.html#t:ConfiguredProgram">ConfiguredProgram</a></p><div class="doc"><p>Make a simple <code><a href="Distribution-Simple-Program-Types.html#t:ConfiguredProgram">ConfiguredProgram</a></code>.
</p><pre> simpleConfiguredProgram &quot;foo&quot; (FoundOnSystem path)
</pre></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>