HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Moduleoptparse-applicative-0.18.1.0Haskell98

Options.Applicative.Extra

  • 4 types
  • 12 values

Extra parser utilities

16 declarations

This module contains high-level functions to run parsers.

valuehelper :: Parser (a -> a)
#

A hidden "helper" option which always fails.

A common usage pattern is to apply this applicatively when creating a ParserInfo

opts :: ParserInfo Sample
opts = info (sample <**> helper) mempty
valuehelperWith :: Mod OptionFields (a -> a) -> Parser (a -> a)
#

Like helper, but with a minimal set of modifiers that can be extended as desired.

opts :: ParserInfo Sample
opts = info (sample <**> helperWith (mconcat [
         long "help",
         short 'h',
         help "Show this help text",
         hidden
       ])) mempty
valuesimpleVersioner
  1. :: String

    Version string to be shown

  2. -> Parser (a -> a)
#

A hidden "--version" option that displays the version.

opts :: ParserInfo Sample
opts = info (sample <**> simpleVersioner "v1.2.3") mempty
valueexecParser :: ParserInfo a -> IO a
#

Run a program description.

Parse command line arguments. Display help text and exit if any parse error occurs.

datadata ParserResult a
#
Instances4Monad, Functor, Applicative, Show
datadata ParserPrefs
#

Global preferences for a top-level Parser.

Constructors

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