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

ModuleCabal-3.12.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.12.1.0
  • Exports11
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceFlag.hs
datadata Flag a
#

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.

Constructors

Instances15Functor, Applicative, Foldable, Traversable, Bounded, Enum, …
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