Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > d124509af43f859ea9fff074ae079c9c > files > 58

ghc-cmdargs-devel-0.7-2.fc14.x86_64.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--Rendered using the Haskell Html Library v0.2-->
<HTML
><HEAD
><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"
><TITLE
>System.Console.CmdArgs.Implicit</TITLE
><LINK HREF="haddock.css" REL="stylesheet" TYPE="text/css"
><SCRIPT SRC="haddock-util.js" TYPE="text/javascript"
></SCRIPT
><SCRIPT TYPE="text/javascript"
>window.onload = function () {setSynopsis("mini_System-Console-CmdArgs-Implicit.html")};</SCRIPT
></HEAD
><BODY
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="topbar"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD
><IMG SRC="haskell_icon.gif" WIDTH="16" HEIGHT="16" ALT=" "
></TD
><TD CLASS="title"
>cmdargs-0.7: Command line argument processing</TD
><TD CLASS="topbut"
><A HREF="src/System-Console-CmdArgs-Implicit.html"
>Source code</A
></TD
><TD CLASS="topbut"
><A HREF="index.html"
>Contents</A
></TD
><TD CLASS="topbut"
><A HREF="doc-index.html"
>Index</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="modulebar"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD
><FONT SIZE="6"
>System.Console.CmdArgs.Implicit</FONT
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="section4"
><B
>Contents</B
></TD
></TR
><TR
><TD
><DL
><DT
><A HREF="#1"
>Running command lines
</A
></DT
><DT
><A HREF="#2"
>Constructing command lines
</A
></DT
><DD
><DL
><DT
><A HREF="#3"
>Impure
</A
></DT
><DT
><A HREF="#4"
>Pure
</A
></DT
></DL
></DD
><DT
><A HREF="#5"
>Re-exported for convenience
</A
></DT
></DL
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section1"
>Description</TD
></TR
><TR
><TD CLASS="doc"
><P
>This module provides simple command line argument processing.
    The main function of interest is <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3AcmdArgs"
>cmdArgs</A
></TT
>.
    A simple example is:
</P
><PRE
>data Sample = Sample {hello :: String} deriving (Show, Data, Typeable)</PRE
><PRE
>
sample = Sample{hello = <TT
><A HREF="System-Console-CmdArgs-Default.html#v%3Adef"
>def</A
></TT
> <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3A%26%3D"
>&amp;=</A
></TT
> <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3Ahelp"
>help</A
></TT
> &quot;World argument&quot; <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3A%26%3D"
>&amp;=</A
></TT
> <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3Aopt"
>opt</A
></TT
> &quot;world&quot;}
         <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3A%26%3D"
>&amp;=</A
></TT
> <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3Asummary"
>summary</A
></TT
> &quot;Sample v1&quot;
</PRE
><PRE
>main = print =&lt;&lt; <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3AcmdArgs"
>cmdArgs</A
></TT
> sample</PRE
><P
>Attributes are used to control a number of behaviours:
</P
><UL
><LI
> The help message: <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3Ahelp"
>help</A
></TT
>, <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3Atyp"
>typ</A
></TT
>, <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3Adetails"
>details</A
></TT
>, <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3Asummary"
>summary</A
></TT
>, <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3Aprogram"
>program</A
></TT
>, <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3Agroupname"
>groupname</A
></TT
>
</LI
><LI
> Flag behaviour: <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3Aopt"
>opt</A
></TT
>, <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3Aenum"
>enum</A
></TT
>, <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3Averbosity"
>verbosity</A
></TT
>, <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3Aignore"
>ignore</A
></TT
>
</LI
><LI
> Flag name assignment: <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3Aname"
>name</A
></TT
>, <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3Aexplicit"
>explicit</A
></TT
>
</LI
><LI
> Controlling non-flag arguments: <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3Aargs"
>args</A
></TT
>, <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3AargPos"
>argPos</A
></TT
>
</LI
><LI
> multi-mode programs: <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3Amodes"
>modes</A
></TT
>, <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3Aauto"
>auto</A
></TT
>
</LI
></UL
><P
><EM
>Supported Types</EM
>: Each field in the record must be one of the supported
    atomic types (<TT
>String</TT
>, <TT
>Int</TT
>, <TT
>Integer</TT
>, <TT
>Float</TT
>, <TT
>Double</TT
>, <TT
>Bool</TT
>, an
    enumeration, a tuple of atomic types) or a list (<TT
>[]</TT
>) or <TT
>Maybe</TT
> wrapping
    at atomic type.
</P
><P
><EM
>Missing Fields</EM
>: If a field is shared by multiple modes, it may be omitted
    in subsequent modes, and will default to the previous value.
</P
><P
><EM
>Purity</EM
>: Values created with annotations are not pure - the first
    time they are computed they will include the annotations, but subsequently
    they will not. If you wish to run the above example in a more robust way:
</P
><PRE
>sample = <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3AcmdArgsMode"
>cmdArgsMode</A
></TT
> $ Sample{hello = ... -- as before</PRE
><PRE
>main = print =&lt;&lt; <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3AcmdArgsRun"
>cmdArgsRun</A
></TT
> sample</PRE
><P
>Even using this scheme, sometimes GHC's optimisations may share values who
    have the same annotation. To disable sharing you may need to specify
    <TT
>{-# OPTIONS_GHC -fno-cse #-}</TT
> in the module you define the flags.
</P
><P
><EM
>Pure annotations</EM
>: Alternatively, you may use pure annotations, which are
    referentially transparent, but less type safe and more verbose. The initial
    example may be written as:
</P
><P
><TT
>sample = <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3Arecord"
>record</A
></TT
> Sample{} [hello := <TT
><A HREF="System-Console-CmdArgs-Default.html#v%3Adef"
>def</A
></TT
> <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3A%2B%3D"
>+=</A
></TT
> <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3Ahelp"
>help</A
></TT
> &quot;World argument&quot; <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3A%2B%3D"
>+=</A
></TT
> <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3Aopt"
>opt</A
></TT
> &quot;world&quot;]</TT
>
    <TT
>         <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3A%2B%3D"
>+=</A
></TT
> <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3Asummary"
>summary</A
></TT
> &quot;Sample v1&quot;</TT
>
</P
><PRE
>main = print =&lt;&lt; (cmdArgs_ sample :: IO Sample)</PRE
><P
>All the examples are written using impure annotations. To convert to pure
    annotations follow the rules:
</P
><PRE
> Ctor {field1 = value1 &amp;= ann1, field2 = value2} &amp;= ann2 ==&gt; record Ctor{} [field1 := value1 += ann1, field2 := value2] += ann2
 Ctor (value1 &amp;= ann1) value2 &amp;= ann2 ==&gt; record Ctor{} [atom value1 += ann1, atom value2] += ann2
 many [Ctor1{...}, Ctor2{...}] ==&gt; many_ [record Ctor1{} [...], record Ctor2{} [...]]
 Ctor {field1 = enum [X &amp;= ann, Y]} ==&gt; record Ctor{} [field1 := enum_ [atom X += ann, atom Y]]
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section1"
>Synopsis</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="decl"
><A HREF="#v%3AcmdArgs"
>cmdArgs</A
> :: <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> a =&gt; a -&gt; <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/System-IO.html#t%3AIO"
>IO</A
> a</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AcmdArgsMode"
>cmdArgsMode</A
> :: <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> a =&gt; a -&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AMode"
>Mode</A
> (<A HREF="System-Console-CmdArgs-Implicit.html#t%3ACmdArgs"
>CmdArgs</A
> a)</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AcmdArgsRun"
>cmdArgsRun</A
> ::  <A HREF="System-Console-CmdArgs-Implicit.html#t%3AMode"
>Mode</A
> (<A HREF="System-Console-CmdArgs-Implicit.html#t%3ACmdArgs"
>CmdArgs</A
> a) -&gt; <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/System-IO.html#t%3AIO"
>IO</A
> a</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AcmdArgs_"
>cmdArgs_</A
> :: <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> a =&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnnotate"
>Annotate</A
> <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
> -&gt; <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/System-IO.html#t%3AIO"
>IO</A
> a</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AcmdArgsMode_"
>cmdArgsMode_</A
> :: <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> a =&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnnotate"
>Annotate</A
> <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
> -&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AMode"
>Mode</A
> (<A HREF="System-Console-CmdArgs-Implicit.html#t%3ACmdArgs"
>CmdArgs</A
> a)</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AcmdArgsApply"
>cmdArgsApply</A
> ::  <A HREF="System-Console-CmdArgs-Implicit.html#t%3ACmdArgs"
>CmdArgs</A
> a -&gt; <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/System-IO.html#t%3AIO"
>IO</A
> a</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><SPAN CLASS="keyword"
>data</SPAN
>  <A HREF="#t%3ACmdArgs"
>CmdArgs</A
> a = <A HREF="#v%3ACmdArgs"
>CmdArgs</A
> {<TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="recfield"
><A HREF="#v%3AcmdArgsValue"
>cmdArgsValue</A
> :: a</TD
></TR
><TR
><TD CLASS="recfield"
><A HREF="#v%3AcmdArgsHelp"
>cmdArgsHelp</A
> :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Maybe.html#t%3AMaybe"
>Maybe</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Char.html#t%3AString"
>String</A
></TD
></TR
><TR
><TD CLASS="recfield"
><A HREF="#v%3AcmdArgsVersion"
>cmdArgsVersion</A
> :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Maybe.html#t%3AMaybe"
>Maybe</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Char.html#t%3AString"
>String</A
></TD
></TR
><TR
><TD CLASS="recfield"
><A HREF="#v%3AcmdArgsVerbosity"
>cmdArgsVerbosity</A
> :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Maybe.html#t%3AMaybe"
>Maybe</A
> <A HREF="System-Console-CmdArgs-Verbosity.html#t%3AVerbosity"
>Verbosity</A
></TD
></TR
><TR
><TD CLASS="recfield"
><A HREF="#v%3AcmdArgsPrivate"
>cmdArgsPrivate</A
> :: CmdArgsPrivate</TD
></TR
></TABLE
>}</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Aopt"
>opt</A
> :: (<A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Text-Show.html#t%3AShow"
>Show</A
> a, <A HREF="System-Console-CmdArgs-Implicit.html#t%3ATypeable"
>Typeable</A
> a) =&gt; a -&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Atyp"
>typ</A
> :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Char.html#t%3AString"
>String</A
> -&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AtypFile"
>typFile</A
> :: <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AtypDir"
>typDir</A
> :: <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Ahelp"
>help</A
> :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Char.html#t%3AString"
>String</A
> -&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Aname"
>name</A
> :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Char.html#t%3AString"
>String</A
> -&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Aargs"
>args</A
> :: <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AargPos"
>argPos</A
> :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Int.html#t%3AInt"
>Int</A
> -&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Agroupname"
>groupname</A
> :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Char.html#t%3AString"
>String</A
> -&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Adetails"
>details</A
> :: [<A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Char.html#t%3AString"
>String</A
>] -&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Asummary"
>summary</A
> :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Char.html#t%3AString"
>String</A
> -&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Aauto"
>auto</A
> :: <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Aprogram"
>program</A
> :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Char.html#t%3AString"
>String</A
> -&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Aexplicit"
>explicit</A
> :: <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Aignore"
>ignore</A
> :: <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Averbosity"
>verbosity</A
> :: <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AhelpArg"
>helpArg</A
> :: [<A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
>] -&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AversionArg"
>versionArg</A
> :: [<A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
>] -&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3AverbosityArgs"
>verbosityArgs</A
> :: [<A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
>] -&gt; [<A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
>] -&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3A%26%3D"
>(&amp;=)</A
> :: <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> val =&gt; val -&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
> -&gt; val</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Amodes"
>modes</A
> :: <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> val =&gt; [val] -&gt; val</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Aenum"
>enum</A
> :: <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> val =&gt; [val] -&gt; val</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3A%2B%3D"
>(+=)</A
> ::  <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnnotate"
>Annotate</A
> ann -&gt; ann -&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnnotate"
>Annotate</A
> ann</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Arecord"
>record</A
> :: <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> a =&gt; a -&gt; [<A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnnotate"
>Annotate</A
> b] -&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnnotate"
>Annotate</A
> b</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Aatom"
>atom</A
> :: <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> val =&gt; val -&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnnotate"
>Annotate</A
> ann</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><SPAN CLASS="keyword"
>data</SPAN
>  <A HREF="#t%3AAnnotate"
>Annotate</A
> ann = <SPAN CLASS="keyword"
>forall</SPAN
> c f . (<A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> c, <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> f) =&gt; (c -&gt; f) <A HREF="#v%3A%3A%3D"
>:=</A
> f</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Aenum_"
>enum_</A
> :: (<A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> c, <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> f) =&gt; (c -&gt; f) -&gt; [<A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnnotate"
>Annotate</A
> <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
>] -&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnnotate"
>Annotate</A
> <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="#v%3Amodes_"
>modes_</A
> :: [<A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnnotate"
>Annotate</A
> <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
>] -&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnnotate"
>Annotate</A
> <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
>module <A HREF="System-Console-CmdArgs-Verbosity.html"
>System.Console.CmdArgs.Verbosity</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
>module <A HREF="System-Console-CmdArgs-Default.html"
>System.Console.CmdArgs.Default</A
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><SPAN CLASS="keyword"
>data</SPAN
>  <A HREF="#t%3AAnn"
>Ann</A
> </TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><SPAN CLASS="keyword"
>data</SPAN
>  <A HREF="#t%3AMode"
>Mode</A
> a</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><SPAN CLASS="keyword"
>class</SPAN
> <A HREF="System-Console-CmdArgs-Implicit.html#t%3ATypeable"
>Typeable</A
> a =&gt; <A HREF="#t%3AData"
>Data</A
> a </TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="decl"
><SPAN CLASS="keyword"
>class</SPAN
>  <A HREF="#t%3ATypeable"
>Typeable</A
> a </TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section1"
><A NAME="1"
><A NAME="1"
>Running command lines
</A
></A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v:cmdArgs"
><A NAME="v%3AcmdArgs"
></A
></A
><B
>cmdArgs</B
> :: <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> a =&gt; a -&gt; <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/System-IO.html#t%3AIO"
>IO</A
> a</TD
><TD CLASS="declbut"
><A HREF="src/System-Console-CmdArgs-Implicit.html#cmdArgs"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
><P
>Take impurely annotated records and run the corresponding command line.
   Shortcut for <TT
><TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3AcmdArgsRun"
>cmdArgsRun</A
></TT
> . <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3AcmdArgsMode"
>cmdArgsMode</A
></TT
></TT
>.
</P
><P
>To use <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3AcmdArgs"
>cmdArgs</A
></TT
> with custom command line arguments see
   System.Environment.withArgs.
</P
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v:cmdArgsMode"
><A NAME="v%3AcmdArgsMode"
></A
></A
><B
>cmdArgsMode</B
> :: <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> a =&gt; a -&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AMode"
>Mode</A
> (<A HREF="System-Console-CmdArgs-Implicit.html#t%3ACmdArgs"
>CmdArgs</A
> a)</TD
><TD CLASS="declbut"
><A HREF="src/System-Console-CmdArgs-Implicit.html#cmdArgsMode"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
><P
>Take impurely annotated records and turn them in to a <TT
><A HREF="System-Console-CmdArgs-Implicit.html#t%3AMode"
>Mode</A
></TT
> value, that can
   make use of the <A HREF="System-Console-CmdArgs-Explicit.html"
>System.Console.CmdArgs.Explicit</A
> functions (i.e. process).
</P
><P
>Annotated records are impure, and will only contain annotations on
   their first use. The result of this function is pure, and can be reused.
</P
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v:cmdArgsRun"
><A NAME="v%3AcmdArgsRun"
></A
></A
><B
>cmdArgsRun</B
> ::  <A HREF="System-Console-CmdArgs-Implicit.html#t%3AMode"
>Mode</A
> (<A HREF="System-Console-CmdArgs-Implicit.html#t%3ACmdArgs"
>CmdArgs</A
> a) -&gt; <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/System-IO.html#t%3AIO"
>IO</A
> a</TD
><TD CLASS="declbut"
><A HREF="src/System-Console-CmdArgs-Implicit.html#cmdArgsRun"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
><P
>Run a Mode structure. This function reads the command line arguments
   and then performs as follows:
</P
><UL
><LI
> If invalid arguments are given, it will display the error message
     and exit.
</LI
><LI
> If <TT
>--help</TT
> is given, it will display the help message and exit.
</LI
><LI
> If <TT
>--version</TT
> is given, it will display the version and exit.
</LI
><LI
> In all other circumstances the program will return a value.
</LI
><LI
> Additionally, if either <TT
>--quiet</TT
> or <TT
>--verbose</TT
> is given (see <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3Averbosity"
>verbosity</A
></TT
>)
     it will set the verbosity (see <TT
><A HREF="System-Console-CmdArgs-Verbosity.html#v%3AsetVerbosity"
>setVerbosity</A
></TT
>).
</LI
></UL
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v:cmdArgs_"
><A NAME="v%3AcmdArgs_"
></A
></A
><B
>cmdArgs_</B
> :: <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> a =&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnnotate"
>Annotate</A
> <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
> -&gt; <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/System-IO.html#t%3AIO"
>IO</A
> a</TD
><TD CLASS="declbut"
><A HREF="src/System-Console-CmdArgs-Implicit.html#cmdArgs_"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
><P
>Take purely annotated records and run the corresponding command line.
   Shortcut for <TT
><TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3AcmdArgsRun"
>cmdArgsRun</A
></TT
> . <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3AcmdArgsMode_"
>cmdArgsMode_</A
></TT
></TT
>.
</P
><P
>To use <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3AcmdArgs_"
>cmdArgs_</A
></TT
> with custom command line arguments see
   System.Environment.withArgs.
</P
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v:cmdArgsMode_"
><A NAME="v%3AcmdArgsMode_"
></A
></A
><B
>cmdArgsMode_</B
> :: <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> a =&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnnotate"
>Annotate</A
> <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
> -&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AMode"
>Mode</A
> (<A HREF="System-Console-CmdArgs-Implicit.html#t%3ACmdArgs"
>CmdArgs</A
> a)</TD
><TD CLASS="declbut"
><A HREF="src/System-Console-CmdArgs-Implicit.html#cmdArgsMode_"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
>Take purely annotated records and turn them in to a <TT
><A HREF="System-Console-CmdArgs-Implicit.html#t%3AMode"
>Mode</A
></TT
> value, that can
   make use of the <A HREF="System-Console-CmdArgs-Explicit.html"
>System.Console.CmdArgs.Explicit</A
> functions (i.e. process).
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v:cmdArgsApply"
><A NAME="v%3AcmdArgsApply"
></A
></A
><B
>cmdArgsApply</B
> ::  <A HREF="System-Console-CmdArgs-Implicit.html#t%3ACmdArgs"
>CmdArgs</A
> a -&gt; <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/System-IO.html#t%3AIO"
>IO</A
> a</TD
><TD CLASS="declbut"
><A HREF="src/System-Console-CmdArgs-Implicit.html#cmdArgsApply"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
><P
>Perform the necessary actions dictated by a <TT
><A HREF="System-Console-CmdArgs-Implicit.html#t%3ACmdArgs"
>CmdArgs</A
></TT
> structure.
</P
><UL
><LI
> If <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3AcmdArgsHelp"
>cmdArgsHelp</A
></TT
> is <TT
>Just</TT
>, it will display the help message and exit.
</LI
><LI
> If <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3AcmdArgsVersion"
>cmdArgsVersion</A
></TT
> is <TT
>Just</TT
>, it will display the version and exit.
</LI
><LI
> In all other circumstances it will return a value.
</LI
><LI
> Additionally, if <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3AcmdArgsVerbosity"
>cmdArgsVerbosity</A
></TT
> is <TT
>Just</TT
> (see <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3Averbosity"
>verbosity</A
></TT
>)
     it will set the verbosity (see <TT
><A HREF="System-Console-CmdArgs-Verbosity.html#v%3AsetVerbosity"
>setVerbosity</A
></TT
>).
</LI
></UL
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><SPAN CLASS="keyword"
>data</SPAN
>  <A NAME="t:CmdArgs"
><A NAME="t%3ACmdArgs"
></A
></A
><B
>CmdArgs</B
> a </TD
><TD CLASS="declbut"
><A HREF="src/System-Console-CmdArgs-Implicit-Type.html#CmdArgs"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="ndoc"
>A structure to store the additional data relating to <TT
>--help</TT
>,
   <TT
>--version</TT
>, <TT
>--quiet</TT
> and <TT
>--verbose</TT
>.
</TD
></TR
><TR
><TD CLASS="section4"
>Constructors</TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="5" CELLPADDING="0"
><TR
><TD CLASS="arg"
><A NAME="v:CmdArgs"
><A NAME="v%3ACmdArgs"
></A
></A
><B
>CmdArgs</B
></TD
><TD CLASS="rdoc"
></TD
></TR
><TR
><TD CLASS="body" COLSPAN="2"
><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0"
><TR
><TD CLASS="arg"
><A NAME="v:cmdArgsValue"
><A NAME="v%3AcmdArgsValue"
></A
></A
><B
>cmdArgsValue</B
> :: a</TD
><TD CLASS="rdoc"
>The underlying value being wrapped.
</TD
></TR
><TR
><TD CLASS="arg"
><A NAME="v:cmdArgsHelp"
><A NAME="v%3AcmdArgsHelp"
></A
></A
><B
>cmdArgsHelp</B
> :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Maybe.html#t%3AMaybe"
>Maybe</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Char.html#t%3AString"
>String</A
></TD
><TD CLASS="rdoc"
><TT
>Just</TT
> if <TT
>--help</TT
> is given, then gives the help message for display, including a trailing newline.
</TD
></TR
><TR
><TD CLASS="arg"
><A NAME="v:cmdArgsVersion"
><A NAME="v%3AcmdArgsVersion"
></A
></A
><B
>cmdArgsVersion</B
> :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Maybe.html#t%3AMaybe"
>Maybe</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Char.html#t%3AString"
>String</A
></TD
><TD CLASS="rdoc"
><TT
>Just</TT
> if <TT
>--version</TT
> is given, then gives the version message for display, including a trailing newline.
</TD
></TR
><TR
><TD CLASS="arg"
><A NAME="v:cmdArgsVerbosity"
><A NAME="v%3AcmdArgsVerbosity"
></A
></A
><B
>cmdArgsVerbosity</B
> :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Maybe.html#t%3AMaybe"
>Maybe</A
> <A HREF="System-Console-CmdArgs-Verbosity.html#t%3AVerbosity"
>Verbosity</A
></TD
><TD CLASS="rdoc"
><TT
>Just</TT
> if <TT
>--quiet</TT
> or <TT
>--verbose</TT
> is given, then gives the verbosity to use.
</TD
></TR
><TR
><TD CLASS="arg"
><A NAME="v:cmdArgsPrivate"
><A NAME="v%3AcmdArgsPrivate"
></A
></A
><B
>cmdArgsPrivate</B
> :: CmdArgsPrivate</TD
><TD CLASS="rdoc"
>Private: Only exported due to Haddock limitations.
</TD
></TR
></TABLE
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="section4"
><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:CmdArgs')" ALT="show/hide"
> Instances</TD
></TR
><TR
><TD CLASS="body"
><DIV ID="i:CmdArgs" STYLE="display:block;"
><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0"
><TR
><TD CLASS="decl"
><A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Control-Monad.html#t%3AFunctor"
>Functor</A
> <A HREF="System-Console-CmdArgs-Implicit.html#t%3ACmdArgs"
>CmdArgs</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Typeable.html#t%3ATypeable1"
>Typeable1</A
> <A HREF="System-Console-CmdArgs-Implicit.html#t%3ACmdArgs"
>CmdArgs</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Eq.html#t%3AEq"
>Eq</A
> a =&gt; <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Eq.html#t%3AEq"
>Eq</A
> (<A HREF="System-Console-CmdArgs-Implicit.html#t%3ACmdArgs"
>CmdArgs</A
> a)</TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> a =&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> (<A HREF="System-Console-CmdArgs-Implicit.html#t%3ACmdArgs"
>CmdArgs</A
> a)</TD
></TR
><TR
><TD CLASS="decl"
><A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Ord.html#t%3AOrd"
>Ord</A
> a =&gt; <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Ord.html#t%3AOrd"
>Ord</A
> (<A HREF="System-Console-CmdArgs-Implicit.html#t%3ACmdArgs"
>CmdArgs</A
> a)</TD
></TR
><TR
><TD CLASS="decl"
><A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Text-Show.html#t%3AShow"
>Show</A
> a =&gt; <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Text-Show.html#t%3AShow"
>Show</A
> (<A HREF="System-Console-CmdArgs-Implicit.html#t%3ACmdArgs"
>CmdArgs</A
> a)</TD
></TR
></TABLE
></DIV
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section1"
><A NAME="2"
><A NAME="2"
>Constructing command lines
</A
></A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="doc"
>Attributes can work on a flag (inside a field), on a mode (outside the record),
   or on all modes (outside the <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3Amodes"
>modes</A
></TT
> call).
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v:opt"
><A NAME="v%3Aopt"
></A
></A
><B
>opt</B
> :: (<A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Text-Show.html#t%3AShow"
>Show</A
> a, <A HREF="System-Console-CmdArgs-Implicit.html#t%3ATypeable"
>Typeable</A
> a) =&gt; a -&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
></TD
><TD CLASS="declbut"
><A HREF="src/System-Console-CmdArgs-Implicit-UI.html#opt"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
><P
>Flag: &quot;I want users to be able to omit the value associated with this flag.&quot;
</P
><P
>Make the value of a flag optional. If <TT
>--flag</TT
> is given, it will
   be treated as <TT
>--flag=<EM
>this_argument</EM
></TT
>.
</P
><PRE
> {hello = def &amp;= opt &quot;foo&quot;}
   -h --hello[=VALUE]    (default=foo)
</PRE
><P
>Note that all flags in CmdArgs are optional, and if omitted will use their default value.
   Those annotated with <TT
>opt</TT
> also allow the flag to be present without an associated value.
   As an example:
</P
><PRE
> {hello = &quot;DEFAULT&quot; &amp;= opt &quot;OPTIONAL&quot;}
</PRE
><PRE
> $ main
 {hello = &quot;DEFAULT&quot;}
 $ main --hello
 {hello = &quot;OPTIONAL&quot;}
 $ main --hello=VALUE
 {hello = &quot;VALUE&quot;}
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v:typ"
><A NAME="v%3Atyp"
></A
></A
><B
>typ</B
> :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Char.html#t%3AString"
>String</A
> -&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
></TD
><TD CLASS="declbut"
><A HREF="src/System-Console-CmdArgs-Implicit-UI.html#typ"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
><P
>Flag: &quot;For this flag, users need to give something of type ...&quot;
</P
><P
>The the type of a flag's value, usually upper case. Only used
   for the help message. Commonly the type will be <TT
>FILE</TT
> (<TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3AtypFile"
>typFile</A
></TT
>)
   or <TT
>DIR</TT
> (<TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3AtypDir"
>typDir</A
></TT
>).
</P
><PRE
> {hello = def &amp;= typ &quot;MESSAGE&quot;}
   -h --hello=MESSAGE
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v:typFile"
><A NAME="v%3AtypFile"
></A
></A
><B
>typFile</B
> :: <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
></TD
><TD CLASS="declbut"
><A HREF="src/System-Console-CmdArgs-Implicit-UI.html#typFile"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
><P
>Flag: &quot;Users must give a file for this flag's value.&quot;
</P
><P
>Alias for <TT
><TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3Atyp"
>typ</A
></TT
> <A HREF="FILE.html"
>FILE</A
></TT
>.
</P
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v:typDir"
><A NAME="v%3AtypDir"
></A
></A
><B
>typDir</B
> :: <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
></TD
><TD CLASS="declbut"
><A HREF="src/System-Console-CmdArgs-Implicit-UI.html#typDir"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
><P
>Flag: &quot;Users must give a directory for this flag's value.&quot;
</P
><P
>Alias for <TT
><TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3Atyp"
>typ</A
></TT
> <A HREF="DIR.html"
>DIR</A
></TT
>.
</P
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v:help"
><A NAME="v%3Ahelp"
></A
></A
><B
>help</B
> :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Char.html#t%3AString"
>String</A
> -&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
></TD
><TD CLASS="declbut"
><A HREF="src/System-Console-CmdArgs-Implicit-UI.html#help"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
><P
>Flag/Mode: &quot;The help message is ...&quot;
</P
><P
>Descriptive text used in the help output.
</P
><PRE
> {hello = def &amp;= help &quot;Help message&quot;}
   -h --hello=VALUE      Help message
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v:name"
><A NAME="v%3Aname"
></A
></A
><B
>name</B
> :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Char.html#t%3AString"
>String</A
> -&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
></TD
><TD CLASS="declbut"
><A HREF="src/System-Console-CmdArgs-Implicit-UI.html#name"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
><P
>Flag: &quot;Use this flag name for this field.&quot;
</P
><P
>Add flags which trigger this option.
</P
><PRE
> {hello = def &amp;= name &quot;foo&quot;}
   -h --hello --foo=VALUE
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v:args"
><A NAME="v%3Aargs"
></A
></A
><B
>args</B
> :: <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
></TD
><TD CLASS="declbut"
><A HREF="src/System-Console-CmdArgs-Implicit-UI.html#args"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
><P
>Flag: &quot;Put non-flag arguments here.&quot;
</P
><PRE
> {hello = def &amp;= args}
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v:argPos"
><A NAME="v%3AargPos"
></A
></A
><B
>argPos</B
> :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Int.html#t%3AInt"
>Int</A
> -&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
></TD
><TD CLASS="declbut"
><A HREF="src/System-Console-CmdArgs-Implicit-UI.html#argPos"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
><P
>Flag: &quot;Put the nth non-flag argument here.&quot;
</P
><P
>This field should be used to store a particular argument position
   (0-based).
</P
><PRE
> {hello = def &amp;= argPos 0}
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v:groupname"
><A NAME="v%3Agroupname"
></A
></A
><B
>groupname</B
> :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Char.html#t%3AString"
>String</A
> -&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
></TD
><TD CLASS="declbut"
><A HREF="src/System-Console-CmdArgs-Implicit-UI.html#groupname"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
><P
>Flag/Mode: &quot;Give these flags/modes a group name in the help output.&quot;
</P
><P
>This mode will be used for all following modes/flags, until the
   next <TT
>groupname</TT
>.
</P
><PRE
> {hello = def &amp;= groupname &quot;Welcomes&quot;}
 Welcomes
   -h --hello=VALUE
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v:details"
><A NAME="v%3Adetails"
></A
></A
><B
>details</B
> :: [<A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Char.html#t%3AString"
>String</A
>] -&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
></TD
><TD CLASS="declbut"
><A HREF="src/System-Console-CmdArgs-Implicit-UI.html#details"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
><P
>Mode: &quot;A longer description of this mode is ...&quot;
</P
><P
>Suffix to be added to the help message.
</P
><PRE
> Sample{..} &amp;= details [&quot;More details on the website www.example.org&quot;]
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v:summary"
><A NAME="v%3Asummary"
></A
></A
><B
>summary</B
> :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Char.html#t%3AString"
>String</A
> -&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
></TD
><TD CLASS="declbut"
><A HREF="src/System-Console-CmdArgs-Implicit-UI.html#summary"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
><P
>Modes: &quot;My program name/version/copyright is ...&quot;
</P
><P
>One line summary of the entire program, the first line of
   <TT
>--help</TT
> and the only line of <TT
>--version</TT
>.
</P
><PRE
> Sample{..} &amp;= summary &quot;CmdArgs v0.0, (C) Neil Mitchell 1981&quot;
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v:auto"
><A NAME="v%3Aauto"
></A
></A
><B
>auto</B
> :: <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
></TD
><TD CLASS="declbut"
><A HREF="src/System-Console-CmdArgs-Implicit-UI.html#auto"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
><P
>Mode: &quot;If the user doesn't give a mode, use this one.&quot;
</P
><P
>This mode is the default. If no mode is specified and a mode has this
   attribute then that mode is selected, otherwise an error is raised.
</P
><PRE
> modes [Mode1{..}, Mode2{..} &amp;= auto, Mode3{..}]
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v:program"
><A NAME="v%3Aprogram"
></A
></A
><B
>program</B
> :: <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Char.html#t%3AString"
>String</A
> -&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
></TD
><TD CLASS="declbut"
><A HREF="src/System-Console-CmdArgs-Implicit-UI.html#program"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
><P
>Modes: &quot;My program executable is named ...&quot;
</P
><P
>This is the name of the program executable. Only used in the help message.
   Defaults to the type of the mode.
</P
><PRE
> Sample{..} &amp;= program &quot;sample&quot;
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v:explicit"
><A NAME="v%3Aexplicit"
></A
></A
><B
>explicit</B
> :: <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
></TD
><TD CLASS="declbut"
><A HREF="src/System-Console-CmdArgs-Implicit-UI.html#explicit"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
><P
>Flag: &quot;Don't guess any names for this field.&quot;
</P
><P
>A field should not have any flag names guessed for it.
   All flag names must be specified by flag.
</P
><PRE
> {hello = def &amp;= explicit &amp;= name &quot;foo&quot;}
   --foo=VALUE
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v:ignore"
><A NAME="v%3Aignore"
></A
></A
><B
>ignore</B
> :: <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
></TD
><TD CLASS="declbut"
><A HREF="src/System-Console-CmdArgs-Implicit-UI.html#ignore"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
><P
>Flag/Mode: &quot;Ignore this field, don't let the user set it.&quot;
</P
><P
>A mode or field is not dealt with by CmdArgs.
</P
><PRE
> {hello = def, extra = def &amp;= ignore}
   --hello=VALUE
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v:verbosity"
><A NAME="v%3Averbosity"
></A
></A
><B
>verbosity</B
> :: <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
></TD
><TD CLASS="declbut"
><A HREF="src/System-Console-CmdArgs-Implicit-UI.html#verbosity"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
><P
>Modes: &quot;My program needs verbosity flags.&quot;
</P
><P
>Add <TT
>--verbose</TT
> and <TT
>--quiet</TT
> flags.
</P
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v:helpArg"
><A NAME="v%3AhelpArg"
></A
></A
><B
>helpArg</B
> :: [<A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
>] -&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
></TD
><TD CLASS="declbut"
><A HREF="src/System-Console-CmdArgs-Implicit-UI.html#helpArg"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
><P
>Modes: &quot;Customise the help argument.&quot;
</P
><P
>Add extra options to a help argument, such as <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3Ahelp"
>help</A
></TT
>, <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3Aname"
>name</A
></TT
>, <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3Aignore"
>ignore</A
></TT
> or <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3Aexplicit"
>explicit</A
></TT
>.
</P
><PRE
> Sample{..} &amp;= helpArg [explicit, name &quot;h&quot;]
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v:versionArg"
><A NAME="v%3AversionArg"
></A
></A
><B
>versionArg</B
> :: [<A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
>] -&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
></TD
><TD CLASS="declbut"
><A HREF="src/System-Console-CmdArgs-Implicit-UI.html#versionArg"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
><P
>Modes: &quot;Customise the version argument.&quot;
</P
><P
>Add extra options to a version argument, such as <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3Ahelp"
>help</A
></TT
>, <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3Aname"
>name</A
></TT
>, <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3Aignore"
>ignore</A
></TT
>, <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3Asummary"
>summary</A
></TT
> or <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3Aexplicit"
>explicit</A
></TT
>.
</P
><PRE
> Sample{..} &amp;= versionArg [ignore]
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v:verbosityArgs"
><A NAME="v%3AverbosityArgs"
></A
></A
><B
>verbosityArgs</B
> :: [<A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
>] -&gt; [<A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
>] -&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
></TD
><TD CLASS="declbut"
><A HREF="src/System-Console-CmdArgs-Implicit-UI.html#verbosityArgs"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
><P
>Modes: &quot;Customise the verbosity arguments.&quot;
</P
><P
>Add extra options to a verbosity arguments (<TT
>--verbose</TT
> and <TT
>--quiet</TT
>),
   such as <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3Ahelp"
>help</A
></TT
>, <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3Aname"
>name</A
></TT
>, <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3Aignore"
>ignore</A
></TT
> or <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3Aexplicit"
>explicit</A
></TT
>. The verbose options come
   first, followed by the quiet options.
</P
><PRE
> Sample{..} &amp;= verbosityArgs [ignore] [name &quot;silent&quot;, explicit]
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section2"
><A NAME="3"
><A NAME="3"
>Impure
</A
></A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v:&="
><A NAME="v%3A%26%3D"
></A
></A
><B
>(&amp;=)</B
> :: <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> val =&gt; val -&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
> -&gt; val</TD
><TD CLASS="declbut"
><A HREF="src/System-Console-CmdArgs-Implicit.html#%26%3D"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
>Add an annotation to a value. Note that if the value is evaluated
   more than once the annotation will only be available the first time.
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v:modes"
><A NAME="v%3Amodes"
></A
></A
><B
>modes</B
> :: <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> val =&gt; [val] -&gt; val</TD
><TD CLASS="declbut"
><A HREF="src/System-Console-CmdArgs-Implicit.html#modes"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
><P
>Modes: &quot;I want a program with multiple modes, like darcs or cabal.&quot;
</P
><P
>Takes a list of modes, and creates a mode which includes them all.
   If you want one of the modes to be chosen by default, see <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3Aauto"
>auto</A
></TT
>.
</P
><PRE
> data Modes = Mode1 | Mode2 | Mode3 deriving Data
 cmdArgs $ modes [Mode1,Mode2,Mode3]
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v:enum"
><A NAME="v%3Aenum"
></A
></A
><B
>enum</B
> :: <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> val =&gt; [val] -&gt; val</TD
><TD CLASS="declbut"
><A HREF="src/System-Console-CmdArgs-Implicit.html#enum"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
><P
>Flag: &quot;I want several different flags to set this one field to different values.&quot;
</P
><P
>This annotation takes a type which is an enumeration, and provides multiple
   separate flags to set the field to each value.
</P
><PRE
> data State = On | Off deriving Data
 data Mode = Mode {state :: State}
 cmdArgs $ Mode {state = enum [On &amp;= help &quot;Turn on&quot;,Off &amp;= help &quot;Turn off&quot;]}
   --on   Turn on
   --off  Turn off
</PRE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section2"
><A NAME="4"
><A NAME="4"
>Pure
</A
></A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v:+="
><A NAME="v%3A%2B%3D"
></A
></A
><B
>(+=)</B
> ::  <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnnotate"
>Annotate</A
> ann -&gt; ann -&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnnotate"
>Annotate</A
> ann</TD
><TD CLASS="declbut"
><A HREF="src/System-Console-CmdArgs-Annotate.html#%2B%3D"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
>Add an annotation to a value.
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v:record"
><A NAME="v%3Arecord"
></A
></A
><B
>record</B
> :: <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> a =&gt; a -&gt; [<A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnnotate"
>Annotate</A
> b] -&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnnotate"
>Annotate</A
> b</TD
><TD CLASS="declbut"
><A HREF="src/System-Console-CmdArgs-Annotate.html#record"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
><P
>Create a constructor/record. The first argument should be
   the type of field, the second should be a list of fields constructed
   originally defined by <TT
>:=</TT
> or <TT
>:=+</TT
>.
</P
><P
>This operation is not type safe, and may raise an exception at runtime
   if any field has the wrong type or label.
</P
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v:atom"
><A NAME="v%3Aatom"
></A
></A
><B
>atom</B
> :: <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> val =&gt; val -&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnnotate"
>Annotate</A
> ann</TD
><TD CLASS="declbut"
><A HREF="src/System-Console-CmdArgs-Annotate.html#atom"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
>Lift a pure value to an annotation.
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><SPAN CLASS="keyword"
>data</SPAN
>  <A NAME="t:Annotate"
><A NAME="t%3AAnnotate"
></A
></A
><B
>Annotate</B
> ann </TD
><TD CLASS="declbut"
><A HREF="src/System-Console-CmdArgs-Annotate.html#Annotate"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="ndoc"
>This type represents an annotated value. The type of the underlying value is not specified.
</TD
></TR
><TR
><TD CLASS="section4"
>Constructors</TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0"
><TR
><TD CLASS="arg"
><SPAN CLASS="keyword"
>forall</SPAN
> c f . (<A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> c, <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> f) =&gt; (c -&gt; f) <A NAME="v::="
><A NAME="v%3A%3A%3D"
></A
></A
><B
>:=</B
> f</TD
><TD CLASS="rdoc"
>Construct a field, <TT
>fieldname := value</TT
>.
</TD
></TR
></TABLE
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v:enum_"
><A NAME="v%3Aenum_"
></A
></A
><B
>enum_</B
> :: (<A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> c, <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> f) =&gt; (c -&gt; f) -&gt; [<A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnnotate"
>Annotate</A
> <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
>] -&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnnotate"
>Annotate</A
> <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
></TD
><TD CLASS="declbut"
><A HREF="src/System-Console-CmdArgs-Implicit.html#enum_"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
>Like <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3Aenum"
>enum</A
></TT
>, but using the pure annotations.
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><A NAME="v:modes_"
><A NAME="v%3Amodes_"
></A
></A
><B
>modes_</B
> :: [<A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnnotate"
>Annotate</A
> <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
>] -&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnnotate"
>Annotate</A
> <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
></TD
><TD CLASS="declbut"
><A HREF="src/System-Console-CmdArgs-Implicit.html#modes_"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="doc"
>Like <TT
><A HREF="System-Console-CmdArgs-Implicit.html#v%3Amodes"
>modes</A
></TT
>, but using the pure annotations.
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="section1"
><A NAME="5"
><A NAME="5"
>Re-exported for convenience
</A
></A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="doc"
>Provides a few opaque types (for writing type signatures),
   verbosity control, default values with <TT
><A HREF="System-Console-CmdArgs-Default.html#v%3Adef"
>def</A
></TT
> and the
   <TT
>Data</TT
>/<TT
>Typeable</TT
> type classes.
</TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
>module <A HREF="System-Console-CmdArgs-Verbosity.html"
>System.Console.CmdArgs.Verbosity</A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="decl"
>module <A HREF="System-Console-CmdArgs-Default.html"
>System.Console.CmdArgs.Default</A
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><SPAN CLASS="keyword"
>data</SPAN
>  <A NAME="t:Ann"
><A NAME="t%3AAnn"
></A
></A
><B
>Ann</B
>  </TD
><TD CLASS="declbut"
><A HREF="src/System-Console-CmdArgs-Implicit-Ann.html#Ann"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="ndoc"
>The general type of annotations that can be associated with a value.
</TD
></TR
><TR
><TD CLASS="section4"
><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:Ann')" ALT="show/hide"
> Instances</TD
></TR
><TR
><TD CLASS="body"
><DIV ID="i:Ann" STYLE="display:block;"
><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0"
><TR
><TD CLASS="decl"
><A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Eq.html#t%3AEq"
>Eq</A
> <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Ord.html#t%3AOrd"
>Ord</A
> <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Text-Show.html#t%3AShow"
>Show</A
> <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3ATypeable"
>Typeable</A
> <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
></TD
></TR
></TABLE
></DIV
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><SPAN CLASS="keyword"
>data</SPAN
>  <A NAME="t:Mode"
><A NAME="t%3AMode"
></A
></A
><B
>Mode</B
> a </TD
><TD CLASS="declbut"
><A HREF="src/System-Console-CmdArgs-Explicit-Type.html#Mode"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="ndoc"
><P
>A mode. Each mode has three main features:
</P
><UL
><LI
> A list of submodes (<TT
><A HREF="System-Console-CmdArgs-Explicit.html#v%3AmodeGroupModes"
>modeGroupModes</A
></TT
>)
</LI
><LI
> A list of flags (<TT
><A HREF="System-Console-CmdArgs-Explicit.html#v%3AmodeGroupFlags"
>modeGroupFlags</A
></TT
>)
</LI
><LI
> Optionally an unnamed argument (<TT
><A HREF="System-Console-CmdArgs-Explicit.html#v%3AmodeArgs"
>modeArgs</A
></TT
>)
</LI
></UL
></TD
></TR
><TR
><TD CLASS="section4"
><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:Mode')" ALT="show/hide"
> Instances</TD
></TR
><TR
><TD CLASS="body"
><DIV ID="i:Mode" STYLE="display:block;"
><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0"
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Explicit.html#t%3ARemap"
>Remap</A
> <A HREF="System-Console-CmdArgs-Implicit.html#t%3AMode"
>Mode</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Text-Show.html#t%3AShow"
>Show</A
> (<A HREF="System-Console-CmdArgs-Implicit.html#t%3AMode"
>Mode</A
> a)</TD
></TR
></TABLE
></DIV
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><SPAN CLASS="keyword"
>class</SPAN
> <A HREF="System-Console-CmdArgs-Implicit.html#t%3ATypeable"
>Typeable</A
> a =&gt; <A NAME="t:Data"
><A NAME="t%3AData"
></A
></A
><B
>Data</B
> a </TD
><TD CLASS="declbut"
><A HREF="src/Data-Data.html#Data"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="ndoc"
><P
>The <TT
><A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
></TT
> class comprehends a fundamental primitive <TT
><A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Data.html#v%3Agfoldl"
>gfoldl</A
></TT
> for
folding over constructor applications, say terms. This primitive can
be instantiated in several ways to map over the immediate subterms
of a term; see the <TT
>gmap</TT
> combinators later in this class.  Indeed, a
generic programmer does not necessarily need to use the ingenious gfoldl
primitive but rather the intuitive <TT
>gmap</TT
> combinators.  The <TT
><A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Data.html#v%3Agfoldl"
>gfoldl</A
></TT
>
primitive is completed by means to query top-level constructors, to
turn constructor representations into proper terms, and to list all
possible datatype constructors.  This completion allows us to serve
generic programming scenarios like read, show, equality, term generation.
</P
><P
>The combinators <TT
><A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Data.html#v%3AgmapT"
>gmapT</A
></TT
>, <TT
><A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Data.html#v%3AgmapQ"
>gmapQ</A
></TT
>, <TT
><A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Data.html#v%3AgmapM"
>gmapM</A
></TT
>, etc are all provided with
default definitions in terms of <TT
><A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Data.html#v%3Agfoldl"
>gfoldl</A
></TT
>, leaving open the opportunity
to provide datatype-specific definitions.
(The inclusion of the <TT
>gmap</TT
> combinators as members of class <TT
><A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
></TT
>
allows the programmer or the compiler to derive specialised, and maybe
more efficient code per datatype.  <EM
>Note</EM
>: <TT
><A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Data.html#v%3Agfoldl"
>gfoldl</A
></TT
> is more higher-order
than the <TT
>gmap</TT
> combinators.  This is subject to ongoing benchmarking
experiments.  It might turn out that the <TT
>gmap</TT
> combinators will be
moved out of the class <TT
><A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
></TT
>.)
</P
><P
>Conceptually, the definition of the <TT
>gmap</TT
> combinators in terms of the
primitive <TT
><A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Data.html#v%3Agfoldl"
>gfoldl</A
></TT
> requires the identification of the <TT
><A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Data.html#v%3Agfoldl"
>gfoldl</A
></TT
> function
arguments.  Technically, we also need to identify the type constructor
<TT
>c</TT
> for the construction of the result type from the folded term type.
</P
><P
>In the definition of <TT
>gmapQ</TT
><EM
>x</EM
> combinators, we use phantom type
constructors for the <TT
>c</TT
> in the type of <TT
><A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Data.html#v%3Agfoldl"
>gfoldl</A
></TT
> because the result type
of a query does not involve the (polymorphic) type of the term argument.
In the definition of <TT
><A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Data.html#v%3AgmapQl"
>gmapQl</A
></TT
> we simply use the plain constant type
constructor because <TT
><A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Data.html#v%3Agfoldl"
>gfoldl</A
></TT
> is left-associative anyway and so it is
readily suited to fold a left-associative binary operation over the
immediate subterms.  In the definition of gmapQr, extra effort is
needed. We use a higher-order accumulation trick to mediate between
left-associative constructor application vs. right-associative binary
operation (e.g., <TT
>(:)</TT
>).  When the query is meant to compute a value
of type <TT
>r</TT
>, then the result type withing generic folding is <TT
>r -&gt; r</TT
>.
So the result of folding is a function to which we finally pass the
right unit.
</P
><P
>With the <TT
>-XDeriveDataTypeable</TT
> option, GHC can generate instances of the
<TT
><A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
></TT
> class automatically.  For example, given the declaration
</P
><TT
> data T a b = C1 a b | C2 deriving (Typeable, Data)
</TT
><P
>GHC will generate an instance that is equivalent to
</P
><TT
> instance (Data a, Data b) =&gt; Data (T a b) where
     gfoldl k z (C1 a b) = z C1 `k` a `k` b
     gfoldl k z C2       = z C2

     gunfold k z c = case constrIndex c of
                         1 -&gt; k (k (z C1))
                         2 -&gt; z C2

     toConstr (C1 _ _) = con_C1
     toConstr C2       = con_C2

     dataTypeOf _ = ty_T

 con_C1 = mkConstr ty_T &quot;C1&quot; [] Prefix
 con_C2 = mkConstr ty_T &quot;C2&quot; [] Prefix
 ty_T   = mkDataType &quot;Module.T&quot; [con_C1, con_C2]
</TT
><P
>This is suitable for datatypes that are exported transparently.
</P
></TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="section4"
><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:Data')" ALT="show/hide"
> Instances</TD
></TR
><TR
><TD CLASS="body"
><DIV ID="i:Data" STYLE="display:block;"
><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0"
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Bool.html#t%3ABool"
>Bool</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Char.html#t%3AChar"
>Char</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Prelude.html#t%3ADouble"
>Double</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Prelude.html#t%3AFloat"
>Float</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Int.html#t%3AInt"
>Int</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Int.html#t%3AInt8"
>Int8</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Int.html#t%3AInt16"
>Int16</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Int.html#t%3AInt32"
>Int32</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Int.html#t%3AInt64"
>Int64</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Prelude.html#t%3AInteger"
>Integer</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Ord.html#t%3AOrdering"
>Ordering</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Word.html#t%3AWord"
>Word</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Word.html#t%3AWord8"
>Word8</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Word.html#t%3AWord16"
>Word16</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Word.html#t%3AWord32"
>Word32</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Word.html#t%3AWord64"
>Word64</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> ()</TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> <A HREF="System-Console-CmdArgs-Verbosity.html#t%3AVerbosity"
>Verbosity</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> CmdArgsPrivate</TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> a =&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> [a]</TD
></TR
><TR
><TD CLASS="decl"
>(<A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> a, <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Prelude.html#t%3AIntegral"
>Integral</A
> a) =&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> (<A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Ratio.html#t%3ARatio"
>Ratio</A
> a)</TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3ATypeable"
>Typeable</A
> a =&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> (<A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Foreign-Ptr.html#t%3APtr"
>Ptr</A
> a)</TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3ATypeable"
>Typeable</A
> a =&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> (<A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Foreign-ForeignPtr.html#t%3AForeignPtr"
>ForeignPtr</A
> a)</TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> a =&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> (<A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Maybe.html#t%3AMaybe"
>Maybe</A
> a)</TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> a =&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> (<A HREF="System-Console-CmdArgs-Implicit.html#t%3ACmdArgs"
>CmdArgs</A
> a)</TD
></TR
><TR
><TD CLASS="decl"
>(<A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> a, <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> b) =&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> (<A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Either.html#t%3AEither"
>Either</A
> a b)</TD
></TR
><TR
><TD CLASS="decl"
>(<A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> a, <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> b) =&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> (a, b)</TD
></TR
><TR
><TD CLASS="decl"
>(<A HREF="System-Console-CmdArgs-Implicit.html#t%3ATypeable"
>Typeable</A
> a, <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> b, <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Ix.html#t%3AIx"
>Ix</A
> a) =&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> (Array a b)</TD
></TR
><TR
><TD CLASS="decl"
>(<A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> a, <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> b, <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> c) =&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> (a, b, c)</TD
></TR
><TR
><TD CLASS="decl"
>(<A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> a, <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> b, <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> c, <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> d) =&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> (a, b, c, d)</TD
></TR
><TR
><TD CLASS="decl"
>(<A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> a, <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> b, <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> c, <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> d, <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> e) =&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> (a, b, c, d, e)</TD
></TR
><TR
><TD CLASS="decl"
>(<A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> a, <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> b, <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> c, <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> d, <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> e, <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> f) =&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> (a, b, c, d, e, f)</TD
></TR
><TR
><TD CLASS="decl"
>(<A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> a, <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> b, <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> c, <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> d, <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> e, <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> f, <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> g) =&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3AData"
>Data</A
> (a, b, c, d, e, f, g)</TD
></TR
></TABLE
></DIV
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="topdecl"
><TABLE CLASS="declbar"
><TR
><TD CLASS="declname"
><SPAN CLASS="keyword"
>class</SPAN
>  <A NAME="t:Typeable"
><A NAME="t%3ATypeable"
></A
></A
><B
>Typeable</B
> a </TD
><TD CLASS="declbut"
><A HREF="src/Data-Typeable.html#Typeable"
>Source</A
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="body"
><TABLE CLASS="vanilla" CELLSPACING="0" CELLPADDING="0"
><TR
><TD CLASS="ndoc"
>The class <TT
><A HREF="System-Console-CmdArgs-Implicit.html#t%3ATypeable"
>Typeable</A
></TT
> allows a concrete representation of a type to
 be calculated.
</TD
></TR
><TR
><TD CLASS="s8"
></TD
></TR
><TR
><TD CLASS="section4"
><IMG SRC="minus.gif" CLASS="coll" ONCLICK="toggle(this,'i:Typeable')" ALT="show/hide"
> Instances</TD
></TR
><TR
><TD CLASS="body"
><DIV ID="i:Typeable" STYLE="display:block;"
><TABLE CLASS="vanilla" CELLSPACING="1" CELLPADDING="0"
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3ATypeable"
>Typeable</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Bool.html#t%3ABool"
>Bool</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3ATypeable"
>Typeable</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Char.html#t%3AChar"
>Char</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3ATypeable"
>Typeable</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Prelude.html#t%3ADouble"
>Double</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3ATypeable"
>Typeable</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Prelude.html#t%3AFloat"
>Float</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3ATypeable"
>Typeable</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Int.html#t%3AInt"
>Int</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3ATypeable"
>Typeable</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Int.html#t%3AInt8"
>Int8</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3ATypeable"
>Typeable</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Int.html#t%3AInt16"
>Int16</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3ATypeable"
>Typeable</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Int.html#t%3AInt32"
>Int32</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3ATypeable"
>Typeable</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Int.html#t%3AInt64"
>Int64</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3ATypeable"
>Typeable</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Prelude.html#t%3AInteger"
>Integer</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3ATypeable"
>Typeable</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Ord.html#t%3AOrdering"
>Ordering</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3ATypeable"
>Typeable</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Control-Monad-ST.html#t%3ARealWorld"
>RealWorld</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3ATypeable"
>Typeable</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Word.html#t%3AWord"
>Word</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3ATypeable"
>Typeable</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Word.html#t%3AWord8"
>Word8</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3ATypeable"
>Typeable</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Word.html#t%3AWord16"
>Word16</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3ATypeable"
>Typeable</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Word.html#t%3AWord32"
>Word32</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3ATypeable"
>Typeable</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Word.html#t%3AWord64"
>Word64</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3ATypeable"
>Typeable</A
> ()</TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3ATypeable"
>Typeable</A
> Handle__</TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3ATypeable"
>Typeable</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Control-Exception-Base.html#t%3APatternMatchFail"
>PatternMatchFail</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3ATypeable"
>Typeable</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Control-Exception-Base.html#t%3ARecSelError"
>RecSelError</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3ATypeable"
>Typeable</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Control-Exception-Base.html#t%3ARecConError"
>RecConError</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3ATypeable"
>Typeable</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Control-Exception-Base.html#t%3ARecUpdError"
>RecUpdError</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3ATypeable"
>Typeable</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Control-Exception-Base.html#t%3ANoMethodError"
>NoMethodError</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3ATypeable"
>Typeable</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Control-Exception-Base.html#t%3ANonTermination"
>NonTermination</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3ATypeable"
>Typeable</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Control-Exception-Base.html#t%3ANestedAtomically"
>NestedAtomically</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3ATypeable"
>Typeable</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/GHC-IO-Handle.html#t%3AHandle"
>Handle</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3ATypeable"
>Typeable</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Control-Exception-Base.html#t%3ASomeException"
>SomeException</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3ATypeable"
>Typeable</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Control-Exception-Base.html#t%3AErrorCall"
>ErrorCall</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3ATypeable"
>Typeable</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Control-Exception-Base.html#t%3AArithException"
>ArithException</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3ATypeable"
>Typeable</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Typeable.html#t%3ATypeRep"
>TypeRep</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3ATypeable"
>Typeable</A
> <A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Typeable.html#t%3ATyCon"
>TyCon</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3ATypeable"
>Typeable</A
> <A HREF="System-Console-CmdArgs-Implicit.html#t%3AAnn"
>Ann</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3ATypeable"
>Typeable</A
> <A HREF="System-Console-CmdArgs-Verbosity.html#t%3AVerbosity"
>Verbosity</A
></TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3ATypeable"
>Typeable</A
> CmdArgsPrivate</TD
></TR
><TR
><TD CLASS="decl"
><A HREF="System-Console-CmdArgs-Implicit.html#t%3ATypeable"
>Typeable</A
> ExceptionInt</TD
></TR
><TR
><TD CLASS="decl"
>(<A HREF="/usr/share/doc/ghc/html/libraries/base-4.2.0.2/Data-Typeable.html#t%3ATypeable1"
>Typeable1</A
> s, <A HREF="System-Console-CmdArgs-Implicit.html#t%3ATypeable"
>Typeable</A
> a) =&gt; <A HREF="System-Console-CmdArgs-Implicit.html#t%3ATypeable"
>Typeable</A
> (s a)</TD
></TR
></TABLE
></DIV
></TD
></TR
></TABLE
></TD
></TR
><TR
><TD CLASS="s15"
></TD
></TR
><TR
><TD CLASS="botbar"
>Produced by <A HREF="http://www.haskell.org/haddock/"
>Haddock</A
> version 2.6.1</TD
></TR
></TABLE
></BODY
></HTML
>