a package:optparse-applicative

For any Applicative functor f, A f is the Arrow instance associated to f. The A constructor can be used to convert a value of type f (a -> b) into an arrow.
An option that always fails. When this option is encountered, the option parser immediately aborts with the given parse error. If you simply want to output a message, use infoOption instead.
Add a bash completion action. Common actions include file and directory. See http://www.gnu.org/software/bash/manual/html_node/Programmable-Completion-Builtins.html#Programmable-Completion-Builtins for a complete list.
Builder for an argument parser.
Option reader based on the Read type class.
Convert a value of type f a into an arrow taking () as argument. Applied to a value of type Parser, it turns it into an arrow that can be used inside an arrow command, or passed to arrow combinators.
Disable parsing of regular options completely. All options and arguments will be treated as a positional arguments. Obviously not recommended in general as options will be unreachable. This is the same behaviour one sees after the "--" pseudo-argument.
(align x) lays out the document x with the nesting level set to the current column. It is used for example to implement hang. As an example, we will put a document right above another one, regardless of the current nesting level. Without alignment, the second line is put simply below everything we've had so far:
>>> "lorem" <+> vsep ["ipsum", "dolor"]
lorem ipsum
dolor
If we add an align to the mix, the vsep's contents all start in the same column:
>>> "lorem" <+> align (vsep ["ipsum", "dolor"])
lorem ipsum
dolor
Separate items in an alternative with a pipe. If the first document and the pipe don't fit on the line, then mandatorily flow the next entry onto the following line. The (//) softbreak ensures that if the document does fit on the line, there is at least a space, but it's possible for y to still appear on the next line.
Change the annotations of a Document. Individual annotations can be removed, changed, or replaced by multiple ones. This is a general function that combines unAnnotate and reAnnotate, and it is useful for mapping semantic annotations (such as »this is a keyword«) to display annotations (such as »this is red and underlined«), because some backends may not care about certain annotations, while others may. Annotations earlier in the new list will be applied earlier, i.e. returning [Bold, Green] will result in a bold document that contains green text, and not vice-versa. Since this traverses the entire Doc tree, including parts that are not rendered due to other layouts fitting better, it is preferrable to reannotate after producing the layout by using alterAnnotationsS.
Change the annotation of a document to a different annotation, or none at all. alterAnnotations for SimpleDocStream. Note that the Doc version is more flexible, since it allows changing a single annotation to multiple ones. (SimpleDocTree restores this flexibility again.)
>>> angles "·"
<·>
Add an annotation to a Doc. This annotation can then be used by the renderer to e.g. add color to certain parts of the output. For a full tutorial example on how to use it, see the Prettyprinter.Render.Tutorials.StackMachineTutorial or Prettyprinter.Render.Tutorials.TreeRenderingTutorial modules. This function is only relevant for custom formats with their own annotations, and not relevant for basic prettyprinting. The predefined renderers, e.g. Prettyprinter.Render.Text, should be enough for the most common needs.
If the result is a positional, if it can't be accessed in the current parser position ( first arg )
This module contains an arrow interface for option parsers, which allows to define and combine parsers using the arrow notation and arrow combinators. The arrow syntax is particularly useful to create parsers of nested structures, or records where the order of fields is different from the order in which the parsers should be applied. For example, an arguments parser often needs to be applied last, and that makes it inconvenient to use it for a field which is not the last one in a record. Using the arrow syntax and the functions in this module, one can write, e.g.:
data Options = Options
{ optArgs :: [String]
, optVerbose :: Bool }

opts :: Parser Options
opts = runA $ proc () -> do
verbose <- asA (switch (short 'v')) -< ()
args <- asA (arguments str idm) -< ()
returnA -< Options args verbose
Parser arrows, created out of regular Parser values using the asA function, are arrows taking () as argument and returning the parsed value.
Layouters should not exceed the specified space per line.
  • The Int is the number of characters, including whitespace, that fit in a line. A typical value is 80.
  • The Double is the ribbon with, i.e. the fraction of the total page width that can be printed on. This allows limiting the length of printable text per line. Values must be between 0 and 1, and 0.4 to 1 is typical.
No options are parsed at all, all arguments are treated as positionals. Is the policy used after `--` is encountered.
This type encapsulates whether an AltNode of an OptTree should be displayed with brackets around it.