/usr/share/doc/libghc-optparse-applicative-doc/html/Options-Applicative-Common.html is in libghc-optparse-applicative-doc 0.10.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | <!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>Options.Applicative.Common</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_Options-Applicative-Common.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Options-Applicative-Common.html">Source</a></li><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">optparse-applicative-0.10.0: Utilities and combinators for parsing command line options</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Safe Haskell</th><td>Safe-Inferred</td></tr></table><p class="caption">Options.Applicative.Common</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Option parsers
</a></li><li><a href="#g:2">Program descriptions
</a></li><li><a href="#g:3">Running parsers
</a></li><li><a href="#g:4">Low-level utilities
</a></li></ul></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:Parser">Parser</a> a</li><li class="src short"><a href="#v:liftOpt">liftOpt</a> :: <a href="Options-Applicative-Types.html#t:Option">Option</a> a -> <a href="Options-Applicative-Common.html#t:Parser">Parser</a> a</li><li class="src short"><a href="#v:showOption">showOption</a> :: <a href="Options-Applicative-Types.html#t:OptName">OptName</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a></li><li class="src short"><span class="keyword">data</span> <a href="#t:ParserInfo">ParserInfo</a> a = <a href="#v:ParserInfo">ParserInfo</a> {<ul class="subs"><li><a href="#v:infoParser">infoParser</a> :: <a href="Options-Applicative-Common.html#t:Parser">Parser</a> a</li><li><a href="#v:infoFullDesc">infoFullDesc</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#t:Bool">Bool</a></li><li><a href="#v:infoProgDesc">infoProgDesc</a> :: <a href="Options-Applicative-Help-Chunk.html#t:Chunk">Chunk</a> <a href="/usr/share/doc/libghc-ansi-wl-pprint-doc/html/Text-PrettyPrint-ANSI-Leijen.html#t:Doc">Doc</a></li><li><a href="#v:infoHeader">infoHeader</a> :: <a href="Options-Applicative-Help-Chunk.html#t:Chunk">Chunk</a> <a href="/usr/share/doc/libghc-ansi-wl-pprint-doc/html/Text-PrettyPrint-ANSI-Leijen.html#t:Doc">Doc</a></li><li><a href="#v:infoFooter">infoFooter</a> :: <a href="Options-Applicative-Help-Chunk.html#t:Chunk">Chunk</a> <a href="/usr/share/doc/libghc-ansi-wl-pprint-doc/html/Text-PrettyPrint-ANSI-Leijen.html#t:Doc">Doc</a></li><li><a href="#v:infoFailureCode">infoFailureCode</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Int.html#t:Int">Int</a></li><li><a href="#v:infoIntersperse">infoIntersperse</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#t:Bool">Bool</a></li></ul>}</li><li class="src short"><span class="keyword">data</span> <a href="#t:ParserPrefs">ParserPrefs</a> = <a href="#v:ParserPrefs">ParserPrefs</a> {<ul class="subs"><li><a href="#v:prefMultiSuffix">prefMultiSuffix</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a></li><li><a href="#v:prefDisambiguate">prefDisambiguate</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#t:Bool">Bool</a></li><li><a href="#v:prefShowHelpOnError">prefShowHelpOnError</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#t:Bool">Bool</a></li><li><a href="#v:prefBacktrack">prefBacktrack</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#t:Bool">Bool</a></li><li><a href="#v:prefColumns">prefColumns</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Int.html#t:Int">Int</a></li></ul>}</li><li class="src short"><a href="#v:runParserInfo">runParserInfo</a> :: <a href="Options-Applicative-Internal.html#t:MonadP">MonadP</a> m => <a href="Options-Applicative-Common.html#t:ParserInfo">ParserInfo</a> a -> <a href="Options-Applicative-Types.html#t:Args">Args</a> -> m a</li><li class="src short"><a href="#v:runParserFully">runParserFully</a> :: <a href="Options-Applicative-Internal.html#t:MonadP">MonadP</a> m => <a href="Options-Applicative-Types.html#t:ArgPolicy">ArgPolicy</a> -> <a href="Options-Applicative-Common.html#t:Parser">Parser</a> a -> <a href="Options-Applicative-Types.html#t:Args">Args</a> -> m a</li><li class="src short"><a href="#v:runParser">runParser</a> :: <a href="Options-Applicative-Internal.html#t:MonadP">MonadP</a> m => <a href="Options-Applicative-Types.html#t:ArgPolicy">ArgPolicy</a> -> <a href="Options-Applicative-Common.html#t:Parser">Parser</a> a -> <a href="Options-Applicative-Types.html#t:Args">Args</a> -> m (a, <a href="Options-Applicative-Types.html#t:Args">Args</a>)</li><li class="src short"><a href="#v:evalParser">evalParser</a> :: <a href="Options-Applicative-Common.html#t:Parser">Parser</a> a -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> a</li><li class="src short"><a href="#v:mapParser">mapParser</a> :: (<span class="keyword">forall</span> x. <a href="Options-Applicative-Types.html#t:OptHelpInfo">OptHelpInfo</a> -> <a href="Options-Applicative-Types.html#t:Option">Option</a> x -> b) -> <a href="Options-Applicative-Common.html#t:Parser">Parser</a> a -> [b]</li><li class="src short"><a href="#v:treeMapParser">treeMapParser</a> :: (<span class="keyword">forall</span> x. <a href="Options-Applicative-Types.html#t:OptHelpInfo">OptHelpInfo</a> -> <a href="Options-Applicative-Types.html#t:Option">Option</a> x -> b) -> <a href="Options-Applicative-Common.html#t:Parser">Parser</a> a -> <a href="Options-Applicative-Types.html#t:OptTree">OptTree</a> b</li><li class="src short"><a href="#v:optionNames">optionNames</a> :: <a href="Options-Applicative-Types.html#t:OptReader">OptReader</a> a -> [<a href="Options-Applicative-Types.html#t:OptName">OptName</a>]</li></ul></div><div id="interface"><h1 id="g:1">Option parsers
</h1><div class="doc"><p>A <code><a href="Options-Applicative-Common.html#t:Parser">Parser</a></code> is composed of a list of options. Several kinds of options
are supported:
</p><ul><li> Flags: simple no-argument options. When a flag is encountered on the
command line, its value is returned.
</li><li> Options: options with an argument. An option can define a <em>reader</em>,
which converts its argument from String to the desired value, or throws a
parse error if the argument does not validate correctly.
</li><li> Arguments: positional arguments, validated in the same way as option
arguments.
</li><li> Commands. A command defines a completely independent sub-parser. When a
command is encountered, the whole command line is passed to the
corresponding parser.
</li></ul></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:Parser" class="def">Parser</a> a <a href="src/Options-Applicative-Types.html#Parser" class="link">Source</a></p><div class="doc"><p>A <code>Parser a</code> is an option parser returning a value of type <code>a</code>.
</p></div><div class="subs instances"><p id="control.i:Parser" class="caption collapser" onclick="toggleSection('i:Parser')">Instances</p><div id="section.i:Parser" class="show"><table><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:Functor">Functor</a> <a href="Options-Applicative-Common.html#t:Parser">Parser</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Applicative.html#t:Applicative">Applicative</a> <a href="Options-Applicative-Common.html#t:Parser">Parser</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Applicative.html#t:Alternative">Alternative</a> <a href="Options-Applicative-Common.html#t:Parser">Parser</a></td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:liftOpt" class="def">liftOpt</a> :: <a href="Options-Applicative-Types.html#t:Option">Option</a> a -> <a href="Options-Applicative-Common.html#t:Parser">Parser</a> a<a href="src/Options-Applicative-Common.html#liftOpt" class="link">Source</a></p><div class="doc"><p>Create a parser composed of a single option.
</p></div></div><div class="top"><p class="src"><a name="v:showOption" class="def">showOption</a> :: <a href="Options-Applicative-Types.html#t:OptName">OptName</a> -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a><a href="src/Options-Applicative-Common.html#showOption" class="link">Source</a></p></div><h1 id="g:2">Program descriptions
</h1><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:ParserInfo" class="def">ParserInfo</a> a <a href="src/Options-Applicative-Types.html#ParserInfo" class="link">Source</a></p><div class="doc"><p>A full description for a runnable <code><a href="Options-Applicative-Common.html#t:Parser">Parser</a></code> for a program.
</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:ParserInfo" class="def">ParserInfo</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><dl><dt class="src"><a name="v:infoParser" class="def">infoParser</a> :: <a href="Options-Applicative-Common.html#t:Parser">Parser</a> a</dt><dd class="doc"><p>the option parser for the program
</p></dd><dt class="src"><a name="v:infoFullDesc" class="def">infoFullDesc</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#t:Bool">Bool</a></dt><dd class="doc"><p>whether the help text should contain full
documentation
</p></dd><dt class="src"><a name="v:infoProgDesc" class="def">infoProgDesc</a> :: <a href="Options-Applicative-Help-Chunk.html#t:Chunk">Chunk</a> <a href="/usr/share/doc/libghc-ansi-wl-pprint-doc/html/Text-PrettyPrint-ANSI-Leijen.html#t:Doc">Doc</a></dt><dd class="doc"><p>brief parser description
</p></dd><dt class="src"><a name="v:infoHeader" class="def">infoHeader</a> :: <a href="Options-Applicative-Help-Chunk.html#t:Chunk">Chunk</a> <a href="/usr/share/doc/libghc-ansi-wl-pprint-doc/html/Text-PrettyPrint-ANSI-Leijen.html#t:Doc">Doc</a></dt><dd class="doc"><p>header of the full parser description
</p></dd><dt class="src"><a name="v:infoFooter" class="def">infoFooter</a> :: <a href="Options-Applicative-Help-Chunk.html#t:Chunk">Chunk</a> <a href="/usr/share/doc/libghc-ansi-wl-pprint-doc/html/Text-PrettyPrint-ANSI-Leijen.html#t:Doc">Doc</a></dt><dd class="doc"><p>footer of the full parser description
</p></dd><dt class="src"><a name="v:infoFailureCode" class="def">infoFailureCode</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Int.html#t:Int">Int</a></dt><dd class="doc"><p>exit code for a parser failure
</p></dd><dt class="src"><a name="v:infoIntersperse" class="def">infoIntersperse</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#t:Bool">Bool</a></dt><dd class="doc"><p>allow regular options and flags to occur
after arguments (default: True)
</p></dd></dl><div class="clear"></div></div></td></tr></table></div><div class="subs instances"><p id="control.i:ParserInfo" class="caption collapser" onclick="toggleSection('i:ParserInfo')">Instances</p><div id="section.i:ParserInfo" class="show"><table><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:Functor">Functor</a> <a href="Options-Applicative-Common.html#t:ParserInfo">ParserInfo</a></td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:ParserPrefs" class="def">ParserPrefs</a> <a href="src/Options-Applicative-Types.html#ParserPrefs" class="link">Source</a></p><div class="doc"><p>Global preferences for a top-level <code><a href="Options-Applicative-Common.html#t:Parser">Parser</a></code>.
</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:ParserPrefs" class="def">ParserPrefs</a></td><td class="doc empty"> </td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><dl><dt class="src"><a name="v:prefMultiSuffix" class="def">prefMultiSuffix</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a></dt><dd class="doc"><p>metavar suffix for multiple options
</p></dd><dt class="src"><a name="v:prefDisambiguate" class="def">prefDisambiguate</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#t:Bool">Bool</a></dt><dd class="doc"><p>automatically disambiguate abbreviations
(default: False)
</p></dd><dt class="src"><a name="v:prefShowHelpOnError" class="def">prefShowHelpOnError</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#t:Bool">Bool</a></dt><dd class="doc"><p>always show help text on parse errors
(default: False)
</p></dd><dt class="src"><a name="v:prefBacktrack" class="def">prefBacktrack</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#t:Bool">Bool</a></dt><dd class="doc"><p>backtrack to parent parser when a
subcommand fails (default: True)
</p></dd><dt class="src"><a name="v:prefColumns" class="def">prefColumns</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Int.html#t:Int">Int</a></dt><dd class="doc"><p>number of columns in the terminal, used to
format the help page (default: 80)
</p></dd></dl><div class="clear"></div></div></td></tr></table></div></div><h1 id="g:3">Running parsers
</h1><div class="top"><p class="src"><a name="v:runParserInfo" class="def">runParserInfo</a> :: <a href="Options-Applicative-Internal.html#t:MonadP">MonadP</a> m => <a href="Options-Applicative-Common.html#t:ParserInfo">ParserInfo</a> a -> <a href="Options-Applicative-Types.html#t:Args">Args</a> -> m a<a href="src/Options-Applicative-Common.html#runParserInfo" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:runParserFully" class="def">runParserFully</a> :: <a href="Options-Applicative-Internal.html#t:MonadP">MonadP</a> m => <a href="Options-Applicative-Types.html#t:ArgPolicy">ArgPolicy</a> -> <a href="Options-Applicative-Common.html#t:Parser">Parser</a> a -> <a href="Options-Applicative-Types.html#t:Args">Args</a> -> m a<a href="src/Options-Applicative-Common.html#runParserFully" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:runParser" class="def">runParser</a> :: <a href="Options-Applicative-Internal.html#t:MonadP">MonadP</a> m => <a href="Options-Applicative-Types.html#t:ArgPolicy">ArgPolicy</a> -> <a href="Options-Applicative-Common.html#t:Parser">Parser</a> a -> <a href="Options-Applicative-Types.html#t:Args">Args</a> -> m (a, <a href="Options-Applicative-Types.html#t:Args">Args</a>)<a href="src/Options-Applicative-Common.html#runParser" class="link">Source</a></p><div class="doc"><p>Apply a <code><a href="Options-Applicative-Common.html#t:Parser">Parser</a></code> to a command line, and return a result and leftover
arguments. This function returns an error if any parsing error occurs, or
if any options are missing and don't have a default value.
</p></div></div><div class="top"><p class="src"><a name="v:evalParser" class="def">evalParser</a> :: <a href="Options-Applicative-Common.html#t:Parser">Parser</a> a -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> a<a href="src/Options-Applicative-Common.html#evalParser" class="link">Source</a></p><div class="doc"><p>The default value of a <code><a href="Options-Applicative-Common.html#t:Parser">Parser</a></code>. This function returns an error if any of
the options don't have a default value.
</p></div></div><h1 id="g:4">Low-level utilities
</h1><div class="top"><p class="src"><a name="v:mapParser" class="def">mapParser</a> :: (<span class="keyword">forall</span> x. <a href="Options-Applicative-Types.html#t:OptHelpInfo">OptHelpInfo</a> -> <a href="Options-Applicative-Types.html#t:Option">Option</a> x -> b) -> <a href="Options-Applicative-Common.html#t:Parser">Parser</a> a -> [b]<a href="src/Options-Applicative-Common.html#mapParser" class="link">Source</a></p><div class="doc"><p>Map a polymorphic function over all the options of a parser, and collect
the results in a list.
</p></div></div><div class="top"><p class="src"><a name="v:treeMapParser" class="def">treeMapParser</a> :: (<span class="keyword">forall</span> x. <a href="Options-Applicative-Types.html#t:OptHelpInfo">OptHelpInfo</a> -> <a href="Options-Applicative-Types.html#t:Option">Option</a> x -> b) -> <a href="Options-Applicative-Common.html#t:Parser">Parser</a> a -> <a href="Options-Applicative-Types.html#t:OptTree">OptTree</a> b<a href="src/Options-Applicative-Common.html#treeMapParser" class="link">Source</a></p><div class="doc"><p>Like <code><a href="Options-Applicative-Common.html#v:mapParser">mapParser</a></code>, but collect the results in a tree structure.
</p></div></div><div class="top"><p class="src"><a name="v:optionNames" class="def">optionNames</a> :: <a href="Options-Applicative-Types.html#t:OptReader">OptReader</a> a -> [<a href="Options-Applicative-Types.html#t:OptName">OptName</a>]<a href="src/Options-Applicative-Common.html#optionNames" class="link">Source</a></p></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.13.2</p></div></body></html>
|