/usr/share/doc/libghc-optparse-simple-doc/html/Options-Applicative-Simple.html is in libghc-optparse-simple-doc 0.0.3-3build1.
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 | <!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.Simple</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-Simple.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Options-Applicative-Simple.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-simple-0.0.3: Simple interface to optparse-applicative</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Safe Haskell</th><td>None</td></tr><tr><th>Language</th><td>Haskell98</td></tr></table><p class="caption">Options.Applicative.Simple</p></div><div id="description"><p class="caption">Description</p><div class="doc"><p>Simple interface to program arguments.</p><p>Typical usage with no commands:</p><pre>do (opts,()) <-
simpleOptions "ver"
"header"
"desc"
(flag () () (long "some-flag"))
empty
doThings opts
</pre><p>Typical usage with commands:</p><pre>do (opts,runCmd) <-
simpleOptions "ver"
"header"
"desc"
(pure ()) $
do addCommand "delete"
"Delete the thing"
(const deleteTheThing)
(pure ())
addCommand "create"
"Create a thing"
createAThing
(strOption (long "hello"))
runCmd
</pre></div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><a href="#v:simpleOptions">simpleOptions</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> -> <a href="file:///usr/share/doc/libghc-optparse-applicative-doc/html/Options-Applicative-Types.html#t:Parser">Parser</a> a -> <a href="file:///usr/share/doc/libghc-either-doc/html/Control-Monad-Trans-Either.html#t:EitherT">EitherT</a> b (<a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.4.2.0/Control-Monad-Trans-Writer-Lazy.html#t:Writer">Writer</a> (<a href="file:///usr/share/doc/libghc-optparse-applicative-doc/html/Options-Applicative-Builder-Internal.html#t:Mod">Mod</a> <a href="file:///usr/share/doc/libghc-optparse-applicative-doc/html/Options-Applicative-Builder-Internal.html#t:CommandFields">CommandFields</a> b)) () -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> (a, b)</li><li class="src short"><a href="#v:simpleVersion">simpleVersion</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Version.html#t:Version">Version</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/template-haskell-2.10.0.0/Language-Haskell-TH-Syntax.html#t:Q">Q</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/template-haskell-2.10.0.0/Language-Haskell-TH-Syntax.html#t:Exp">Exp</a></li><li class="src short"><a href="#v:addCommand">addCommand</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> -> (a -> b) -> <a href="file:///usr/share/doc/libghc-optparse-applicative-doc/html/Options-Applicative-Types.html#t:Parser">Parser</a> a -> <a href="file:///usr/share/doc/libghc-either-doc/html/Control-Monad-Trans-Either.html#t:EitherT">EitherT</a> b (<a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.4.2.0/Control-Monad-Trans-Writer-Lazy.html#t:Writer">Writer</a> (<a href="file:///usr/share/doc/libghc-optparse-applicative-doc/html/Options-Applicative-Builder-Internal.html#t:Mod">Mod</a> <a href="file:///usr/share/doc/libghc-optparse-applicative-doc/html/Options-Applicative-Builder-Internal.html#t:CommandFields">CommandFields</a> b)) ()</li><li class="src short"><a href="#v:addSubCommands">addSubCommands</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a> -> <a href="file:///usr/share/doc/libghc-either-doc/html/Control-Monad-Trans-Either.html#t:EitherT">EitherT</a> b (<a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.4.2.0/Control-Monad-Trans-Writer-Lazy.html#t:Writer">Writer</a> (<a href="file:///usr/share/doc/libghc-optparse-applicative-doc/html/Options-Applicative-Builder-Internal.html#t:Mod">Mod</a> <a href="file:///usr/share/doc/libghc-optparse-applicative-doc/html/Options-Applicative-Builder-Internal.html#t:CommandFields">CommandFields</a> b)) () -> <a href="file:///usr/share/doc/libghc-either-doc/html/Control-Monad-Trans-Either.html#t:EitherT">EitherT</a> b (<a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.4.2.0/Control-Monad-Trans-Writer-Lazy.html#t:Writer">Writer</a> (<a href="file:///usr/share/doc/libghc-optparse-applicative-doc/html/Options-Applicative-Builder-Internal.html#t:Mod">Mod</a> <a href="file:///usr/share/doc/libghc-optparse-applicative-doc/html/Options-Applicative-Builder-Internal.html#t:CommandFields">CommandFields</a> b)) ()</li><li class="src short"><a href="#v:simpleParser">simpleParser</a> :: <a href="file:///usr/share/doc/libghc-optparse-applicative-doc/html/Options-Applicative-Types.html#t:Parser">Parser</a> a -> <a href="file:///usr/share/doc/libghc-either-doc/html/Control-Monad-Trans-Either.html#t:EitherT">EitherT</a> b (<a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.4.2.0/Control-Monad-Trans-Writer-Lazy.html#t:Writer">Writer</a> (<a href="file:///usr/share/doc/libghc-optparse-applicative-doc/html/Options-Applicative-Builder-Internal.html#t:Mod">Mod</a> <a href="file:///usr/share/doc/libghc-optparse-applicative-doc/html/Options-Applicative-Builder-Internal.html#t:CommandFields">CommandFields</a> b)) () -> <a href="file:///usr/share/doc/libghc-optparse-applicative-doc/html/Options-Applicative-Types.html#t:Parser">Parser</a> (a, b)</li><li class="src short">module <a href="file:///usr/share/doc/libghc-optparse-applicative-doc/html/Options-Applicative.html">Options.Applicative</a></li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><a name="v:simpleOptions" class="def">simpleOptions</a> <a href="src/Options-Applicative-Simple.html#simpleOptions" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a></td><td class="doc"><p>version string</p></td></tr><tr><td class="src">-> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a></td><td class="doc"><p>header</p></td></tr><tr><td class="src">-> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a></td><td class="doc"><p>program description</p></td></tr><tr><td class="src">-> <a href="file:///usr/share/doc/libghc-optparse-applicative-doc/html/Options-Applicative-Types.html#t:Parser">Parser</a> a</td><td class="doc"><p>global settings</p></td></tr><tr><td class="src">-> <a href="file:///usr/share/doc/libghc-either-doc/html/Control-Monad-Trans-Either.html#t:EitherT">EitherT</a> b (<a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.4.2.0/Control-Monad-Trans-Writer-Lazy.html#t:Writer">Writer</a> (<a href="file:///usr/share/doc/libghc-optparse-applicative-doc/html/Options-Applicative-Builder-Internal.html#t:Mod">Mod</a> <a href="file:///usr/share/doc/libghc-optparse-applicative-doc/html/Options-Applicative-Builder-Internal.html#t:CommandFields">CommandFields</a> b)) ()</td><td class="doc"><p>commands (use <code><a href="Options-Applicative-Simple.html#v:addCommand">addCommand</a></code>)</p></td></tr><tr><td class="src">-> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/System-IO.html#t:IO">IO</a> (a, b)</td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Generate and execute a simple options parser.</p></div></div><div class="top"><p class="src"><a name="v:simpleVersion" class="def">simpleVersion</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-Version.html#t:Version">Version</a> -> <a href="file:///usr/share/doc/ghc-doc/html/libraries/template-haskell-2.10.0.0/Language-Haskell-TH-Syntax.html#t:Q">Q</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/template-haskell-2.10.0.0/Language-Haskell-TH-Syntax.html#t:Exp">Exp</a> <a href="src/Options-Applicative-Simple.html#simpleVersion" class="link">Source</a></p><div class="doc"><p>Generate a string like <code>Version 1.2, Git revision 1234</code>.</p><p><code>$(simpleVersion …)</code> <code>::</code> <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a></code></p></div></div><div class="top"><p class="src"><a name="v:addCommand" class="def">addCommand</a> <a href="src/Options-Applicative-Simple.html#addCommand" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a></td><td class="doc"><p>command string</p></td></tr><tr><td class="src">-> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a></td><td class="doc"><p>title of command</p></td></tr><tr><td class="src">-> (a -> b)</td><td class="doc"><p>constructor to wrap up command in common data type</p></td></tr><tr><td class="src">-> <a href="file:///usr/share/doc/libghc-optparse-applicative-doc/html/Options-Applicative-Types.html#t:Parser">Parser</a> a</td><td class="doc"><p>command parser</p></td></tr><tr><td class="src">-> <a href="file:///usr/share/doc/libghc-either-doc/html/Control-Monad-Trans-Either.html#t:EitherT">EitherT</a> b (<a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.4.2.0/Control-Monad-Trans-Writer-Lazy.html#t:Writer">Writer</a> (<a href="file:///usr/share/doc/libghc-optparse-applicative-doc/html/Options-Applicative-Builder-Internal.html#t:Mod">Mod</a> <a href="file:///usr/share/doc/libghc-optparse-applicative-doc/html/Options-Applicative-Builder-Internal.html#t:CommandFields">CommandFields</a> b)) ()</td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Add a command to the options dispatcher.</p></div></div><div class="top"><p class="src"><a name="v:addSubCommands" class="def">addSubCommands</a> <a href="src/Options-Applicative-Simple.html#addSubCommands" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a></td><td class="doc"><p>command string</p></td></tr><tr><td class="src">-> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.8.2.0/Data-String.html#t:String">String</a></td><td class="doc"><p>title of command</p></td></tr><tr><td class="src">-> <a href="file:///usr/share/doc/libghc-either-doc/html/Control-Monad-Trans-Either.html#t:EitherT">EitherT</a> b (<a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.4.2.0/Control-Monad-Trans-Writer-Lazy.html#t:Writer">Writer</a> (<a href="file:///usr/share/doc/libghc-optparse-applicative-doc/html/Options-Applicative-Builder-Internal.html#t:Mod">Mod</a> <a href="file:///usr/share/doc/libghc-optparse-applicative-doc/html/Options-Applicative-Builder-Internal.html#t:CommandFields">CommandFields</a> b)) ()</td><td class="doc"><p>sub-commands (use <code><a href="Options-Applicative-Simple.html#v:addCommand">addCommand</a></code>)</p></td></tr><tr><td class="src">-> <a href="file:///usr/share/doc/libghc-either-doc/html/Control-Monad-Trans-Either.html#t:EitherT">EitherT</a> b (<a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.4.2.0/Control-Monad-Trans-Writer-Lazy.html#t:Writer">Writer</a> (<a href="file:///usr/share/doc/libghc-optparse-applicative-doc/html/Options-Applicative-Builder-Internal.html#t:Mod">Mod</a> <a href="file:///usr/share/doc/libghc-optparse-applicative-doc/html/Options-Applicative-Builder-Internal.html#t:CommandFields">CommandFields</a> b)) ()</td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Add a command that takes sub-commands to the options dispatcher.</p><p>Example:</p><pre>addSubCommands "thing"
"Subcommands that operate on things"
(do addCommand "delete"
"Delete the thing"
(const deleteTheThing)
(pure ())
addCommand "create"
"Create a thing"
createAThing
(strOption (long "hello")))
</pre><p>If there are common options between all the sub-commands, use <code><a href="Options-Applicative-Simple.html#v:addCommand">addCommand</a></code>
in combination with <code><a href="Options-Applicative-Simple.html#v:simpleParser">simpleParser</a></code> instead of <code><a href="Options-Applicative-Simple.html#v:addSubCommands">addSubCommands</a></code>.</p></div></div><div class="top"><p class="src"><a name="v:simpleParser" class="def">simpleParser</a> <a href="src/Options-Applicative-Simple.html#simpleParser" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="file:///usr/share/doc/libghc-optparse-applicative-doc/html/Options-Applicative-Types.html#t:Parser">Parser</a> a</td><td class="doc"><p>common settings</p></td></tr><tr><td class="src">-> <a href="file:///usr/share/doc/libghc-either-doc/html/Control-Monad-Trans-Either.html#t:EitherT">EitherT</a> b (<a href="file:///usr/share/doc/ghc-doc/html/libraries/transformers-0.4.2.0/Control-Monad-Trans-Writer-Lazy.html#t:Writer">Writer</a> (<a href="file:///usr/share/doc/libghc-optparse-applicative-doc/html/Options-Applicative-Builder-Internal.html#t:Mod">Mod</a> <a href="file:///usr/share/doc/libghc-optparse-applicative-doc/html/Options-Applicative-Builder-Internal.html#t:CommandFields">CommandFields</a> b)) ()</td><td class="doc"><p>commands (use <code><a href="Options-Applicative-Simple.html#v:addCommand">addCommand</a></code>)</p></td></tr><tr><td class="src">-> <a href="file:///usr/share/doc/libghc-optparse-applicative-doc/html/Options-Applicative-Types.html#t:Parser">Parser</a> (a, b)</td><td class="doc empty"> </td></tr></table></div><div class="doc"><p>Generate a simple options parser.</p><p>Most of the time you should use <code><a href="Options-Applicative-Simple.html#v:simpleOptions">simpleOptions</a></code> instead, but <code><a href="Options-Applicative-Simple.html#v:simpleParser">simpleParser</a></code>
can be used for sub-commands that need common options. For example:</p><pre>addCommand "thing"
"Subcommands that operate on things"
(\(opts,runSubCmd) -> runSubCmd opts)
(simpleParser (flag () () (long "some-flag")) $
do addCommand "delete"
"Delete the thing"
(const deleteTheThing)
(pure ())
addCommand "create"
"Create a thing"
createAThing
(strOption (long "hello")))
</pre></div></div><div class="top"><p class="src">module <a href="file:///usr/share/doc/libghc-optparse-applicative-doc/html/Options-Applicative.html">Options.Applicative</a></p></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.16.1</p></div></body></html>
|