HORIZON HASKELLDocslts/ghc-10.0.xaa25b892026-10-10Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · aa25b89 · 2026-10-10

ModuleCabal-3.18.1.0Haskell2010

Distribution.Simple.Flag

Defines the Flag type and it's Monoid instance, see http://www.haskell.org/pipermail/cabal-devel/2007-December/001509.html for an explanation.

Split off from Distribution.Simple.Setup to break import cycles.

  • 1 type
  • 1 class
  • 9 values
  • PackageCabal-3.18.1.0
  • Exports13
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceFlag.hs
typetype Flag = Last
#

All flags are monoids, they come in two flavours:

  1. list flags eg

--ghc-option=foo --ghc-option=bar

gives us all the values ["foo", "bar"]

  1. singular value flags, eg:

--enable-foo --disable-foo

gives us Just False

So, this Flag type is for the latter singular kind of flag. Its monoid instance gives us the behaviour where it starts out as NoFlag and later flags override earlier ones.

Isomorphic to Maybe a.

valueflagElim :: b -> (a -> b) -> Flag a -> b
#

Pushes a function through a Flag value, and returns a default if the Flag value is NoFlag.

classclass BooleanFlag a where
#

Types that represent boolean flags.

Methods

Instances1BooleanFlag