Cabal-3.2.1.0: A framework for packaging Haskell software
Copyright Isaac Jones 2003-2004
Duncan Coutts 2007
License BSD3
Maintainer cabal-devel@haskell.org
Portability portable
Safe Haskell None
Language Haskell2010

Distribution.Simple.Flag

Description

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.

Synopsis

Documentation

data Flag a Source #

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.

Constructors

Flag a
NoFlag

Instances

Instances details
Functor Flag Source #
Instance details

Defined in Distribution.Simple.Flag

Applicative Flag Source #
Instance details

Defined in Distribution.Simple.Flag

Bounded a => Bounded ( Flag a) Source #
Instance details

Defined in Distribution.Simple.Flag

Enum a => Enum ( Flag a) Source #
Instance details

Defined in Distribution.Simple.Flag

Eq a => Eq ( Flag a) Source #
Instance details

Defined in Distribution.Simple.Flag

Read a => Read ( Flag a) Source #
Instance details

Defined in Distribution.Simple.Flag

Show a => Show ( Flag a) Source #
Instance details

Defined in Distribution.Simple.Flag

Generic ( Flag a) Source #
Instance details

Defined in Distribution.Simple.Flag

Associated Types

type Rep ( Flag a) :: Type -> Type Source #

Semigroup ( Flag a) Source #
Instance details

Defined in Distribution.Simple.Flag

Monoid ( Flag a) Source #
Instance details

Defined in Distribution.Simple.Flag

Binary a => Binary ( Flag a) Source #
Instance details

Defined in Distribution.Simple.Flag

Structured a => Structured ( Flag a) Source #
Instance details

Defined in Distribution.Simple.Flag

type Rep ( Flag a) Source #
Instance details

Defined in Distribution.Simple.Flag

type Rep ( Flag a) = D1 (' MetaData "Flag" "Distribution.Simple.Flag" "Cabal-3.2.1.0-3w1fQQbNnuQ5xlFGwVXcPy" ' False ) ( C1 (' MetaCons "Flag" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 a)) :+: C1 (' MetaCons "NoFlag" ' PrefixI ' False ) ( U1 :: Type -> Type ))

class BooleanFlag a where Source #

Types that represent boolean flags.

Instances

Instances details
BooleanFlag Bool Source #
Instance details

Defined in Distribution.Simple.Flag