HORIZON HASKELLDocslts/ghc-9.14.x3e2d5682026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · 3e2d568 · 2026-10-11

Moduleopt-env-conf-0.15.0.3Haskell2010

OptEnvConf.Setting

  • 8 types
  • 36 values
datadata Setting a
#

A setting for parsing and documenting a single value.

Constructors

Builders

29 declarations
valueswitch :: a -> Builder a
#

Try to parse a switch, activate the given value when succesful

You'll also need to add at least one long or short.

Multiple switchs override eachother.

valuereader :: Reader a -> Builder a
#

Declare how to parse an argument, option, or environment variable.

valuestr :: IsString s => Reader s
#

Read a string as-is.

This is the reader you will want to use for reading a String.

This is different from auto for strings because Read wants to parse quotes when parsing Strings.

valueauto :: Read a => Reader a
#

Read via the Read instance

You cannot use this for bare strings, because Read for strings parses quotes.

valuelong :: String -> Builder a
#

Try to parse this long option or switch.

long "foo" corresponds to --foo

Notes: * Parsing options with an empty name in the long is not supported. * Parsing options with an = sign in the long is not supported.

Multiple longs will be tried in order. Empty longs will be ignored.

valuevalue :: Show a => a -> Builder a
#

Set the default value

Multiple values override eachother.

API Note: default is not a valid identifier in Haskell. I'd also have preferred default instead.

valuehidden :: Builder a
#

Don't show this setting in documentation

Multiple hiddens are redundant.

The annotation for any setting reading secrets.

We add these so that we can disable them in settings checks, to avoid failing settings checks when secrets are read at runtime instead of build-time.

Internal

12 declarations