HORIZON HASKELLDocslts/ghc-9.14.x7a6c33e2026-10-12Search packagesCtrl K
Theme: |

GHC 9.14.1 · lts/ghc-9.14.x · 7a6c33e · 2026-10-12

Moduleoptparse-applicative-0.19.0.0Haskell98

Options.Applicative.Common

Contents
  1. Option parsers
  2. Program descriptions
  3. Running parsers
  4. Low-level utilities
Synopsis

Option parsers

A Parser is composed of a list of options. Several kinds of options are supported:

  • Flags: simple no-argument options. When a flag is encountered on the command line, its value is returned.

  • Options: options with an argument. An option can define a reader, which converts its argument from String to the desired value, or throws a parse error if the argument does not validate correctly.

  • Arguments: positional arguments, validated in the same way as option arguments.

  • Commands. A command defines a completely independent sub-parser. When a command is encountered, the whole command line is passed to the corresponding parser.

datadata Parser a

A Parser a is an option parser returning a value of type a.

Instances3Functor, Applicative, Alternative
  • Functor ParserDefined in optparse-applicative-0.19.0.0 · Options.Applicative.Types
  • Applicative ParserDefined in optparse-applicative-0.19.0.0 · Options.Applicative.Types
  • Alternative ParserDefined in optparse-applicative-0.19.0.0 · Options.Applicative.Types

Program descriptions

datadata ParserInfo a

A full description for a runnable Parser for a program.

Constructors

Instances1Functor
  • Functor ParserInfoDefined in optparse-applicative-0.19.0.0 · Options.Applicative.Types
datadata ParserPrefs

Global preferences for a top-level Parser.

Constructors

Instances2Eq, Show
  • Eq ParserPrefsDefined in optparse-applicative-0.19.0.0 · Options.Applicative.Types
  • Show ParserPrefsDefined in optparse-applicative-0.19.0.0 · Options.Applicative.Types

Running parsers

Low-level utilities