Cabal-3.2.1.0: A framework for packaging Haskell software
Safe Haskell None
Language Haskell2010

Distribution.Types.Flag

Synopsis

Documentation

data Flag Source #

A flag can represent a feature to be included, or a way of linking a target against its dependencies, or in fact whatever you can think of.

Instances

Instances details
Eq Flag Source #
Instance details

Defined in Distribution.Types.Flag

Data Flag Source #
Instance details

Defined in Distribution.Types.Flag

Methods

gfoldl :: ( forall d b. Data d => c (d -> b) -> d -> c b) -> ( forall g. g -> c g) -> Flag -> c Flag Source #

gunfold :: ( forall b r. Data b => c (b -> r) -> c r) -> ( forall r. r -> c r) -> Constr -> c Flag Source #

toConstr :: Flag -> Constr Source #

dataTypeOf :: Flag -> DataType Source #

dataCast1 :: Typeable t => ( forall d. Data d => c (t d)) -> Maybe (c Flag ) Source #

dataCast2 :: Typeable t => ( forall d e. ( Data d, Data e) => c (t d e)) -> Maybe (c Flag ) Source #

gmapT :: ( forall b. Data b => b -> b) -> Flag -> Flag Source #

gmapQl :: (r -> r' -> r) -> r -> ( forall d. Data d => d -> r') -> Flag -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> ( forall d. Data d => d -> r') -> Flag -> r Source #

gmapQ :: ( forall d. Data d => d -> u) -> Flag -> [u] Source #

gmapQi :: Int -> ( forall d. Data d => d -> u) -> Flag -> u Source #

gmapM :: Monad m => ( forall d. Data d => d -> m d) -> Flag -> m Flag Source #

gmapMp :: MonadPlus m => ( forall d. Data d => d -> m d) -> Flag -> m Flag Source #

gmapMo :: MonadPlus m => ( forall d. Data d => d -> m d) -> Flag -> m Flag Source #

Show Flag Source #
Instance details

Defined in Distribution.Types.Flag

Generic Flag Source #
Instance details

Defined in Distribution.Types.Flag

Associated Types

type Rep Flag :: Type -> Type Source #

Binary Flag Source #
Instance details

Defined in Distribution.Types.Flag

NFData Flag Source #
Instance details

Defined in Distribution.Types.Flag

Structured Flag Source #
Instance details

Defined in Distribution.Types.Flag

type Rep Flag Source #
Instance details

Defined in Distribution.Types.Flag

emptyFlag :: FlagName -> Flag Source #

A Flag initialized with default parameters.

data FlagName Source #

A FlagName is the name of a user-defined configuration flag

Use mkFlagName and unFlagName to convert from/to a String .

This type is opaque since Cabal-2.0

Since: 2.0.0.2

Instances

Instances details
Eq FlagName Source #
Instance details

Defined in Distribution.Types.Flag

Data FlagName Source #
Instance details

Defined in Distribution.Types.Flag

Methods

gfoldl :: ( forall d b. Data d => c (d -> b) -> d -> c b) -> ( forall g. g -> c g) -> FlagName -> c FlagName Source #

gunfold :: ( forall b r. Data b => c (b -> r) -> c r) -> ( forall r. r -> c r) -> Constr -> c FlagName Source #

toConstr :: FlagName -> Constr Source #

dataTypeOf :: FlagName -> DataType Source #

dataCast1 :: Typeable t => ( forall d. Data d => c (t d)) -> Maybe (c FlagName ) Source #

dataCast2 :: Typeable t => ( forall d e. ( Data d, Data e) => c (t d e)) -> Maybe (c FlagName ) Source #

gmapT :: ( forall b. Data b => b -> b) -> FlagName -> FlagName Source #

gmapQl :: (r -> r' -> r) -> r -> ( forall d. Data d => d -> r') -> FlagName -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> ( forall d. Data d => d -> r') -> FlagName -> r Source #

gmapQ :: ( forall d. Data d => d -> u) -> FlagName -> [u] Source #

gmapQi :: Int -> ( forall d. Data d => d -> u) -> FlagName -> u Source #

gmapM :: Monad m => ( forall d. Data d => d -> m d) -> FlagName -> m FlagName Source #

gmapMp :: MonadPlus m => ( forall d. Data d => d -> m d) -> FlagName -> m FlagName Source #

gmapMo :: MonadPlus m => ( forall d. Data d => d -> m d) -> FlagName -> m FlagName Source #

Ord FlagName Source #
Instance details

Defined in Distribution.Types.Flag

Read FlagName Source #
Instance details

Defined in Distribution.Types.Flag

Show FlagName Source #
Instance details

Defined in Distribution.Types.Flag

IsString FlagName Source #

mkFlagName

Since: 2.0.0.2

Instance details

Defined in Distribution.Types.Flag

Generic FlagName Source #
Instance details

Defined in Distribution.Types.Flag

Binary FlagName Source #
Instance details

Defined in Distribution.Types.Flag

NFData FlagName Source #
Instance details

Defined in Distribution.Types.Flag

Structured FlagName Source #
Instance details

Defined in Distribution.Types.Flag

Pretty FlagName Source #
Instance details

Defined in Distribution.Types.Flag

Parsec FlagName Source #
Instance details

Defined in Distribution.Types.Flag

type Rep FlagName Source #
Instance details

Defined in Distribution.Types.Flag

type Rep FlagName = D1 (' MetaData "FlagName" "Distribution.Types.Flag" "Cabal-3.2.1.0-3w1fQQbNnuQ5xlFGwVXcPy" ' True ) ( C1 (' MetaCons "FlagName" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ShortText )))

mkFlagName :: String -> FlagName Source #

Construct a FlagName from a String

mkFlagName is the inverse to unFlagName

Note: No validations are performed to ensure that the resulting FlagName is valid

Since: 2.0.0.2

data FlagAssignment Source #

A FlagAssignment is a total or partial mapping of FlagName s to Bool flag values. It represents the flags chosen by the user or discovered during configuration. For example --flags=foo --flags=-bar becomes [("foo", True), ("bar", False)]

Instances

Instances details
Eq FlagAssignment Source #
Instance details

Defined in Distribution.Types.Flag

Ord FlagAssignment Source #
Instance details

Defined in Distribution.Types.Flag

Read FlagAssignment Source #

Since: 2.2.0

Instance details

Defined in Distribution.Types.Flag

Show FlagAssignment Source #

Since: 2.2.0

Instance details

Defined in Distribution.Types.Flag

Generic FlagAssignment Source #
Instance details

Defined in Distribution.Types.Flag

Semigroup FlagAssignment Source #
Instance details

Defined in Distribution.Types.Flag

Monoid FlagAssignment Source #
Instance details

Defined in Distribution.Types.Flag

Binary FlagAssignment Source #
Instance details

Defined in Distribution.Types.Flag

NFData FlagAssignment Source #
Instance details

Defined in Distribution.Types.Flag

Structured FlagAssignment Source #
Instance details

Defined in Distribution.Types.Flag

type Rep FlagAssignment Source #
Instance details

Defined in Distribution.Types.Flag

type Rep FlagAssignment = D1 (' MetaData "FlagAssignment" "Distribution.Types.Flag" "Cabal-3.2.1.0-3w1fQQbNnuQ5xlFGwVXcPy" ' True ) ( C1 (' MetaCons "FlagAssignment" ' PrefixI ' True ) ( S1 (' MetaSel (' Just "getFlagAssignment") ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 ( Map FlagName ( Int , Bool )))))

mkFlagAssignment :: [( FlagName , Bool )] -> FlagAssignment Source #

Construct a FlagAssignment from a list of flag/value pairs.

If duplicate flags occur in the input list, the later entries in the list will take precedence.

Since: 2.2.0

unFlagAssignment :: FlagAssignment -> [( FlagName , Bool )] Source #

Deconstruct a FlagAssignment into a list of flag/value pairs.

 null (findDuplicateFlagAssignments fa) ==> (mkFlagAssignment . unFlagAssignment) fa == fa

Since: 2.2.0

lookupFlagAssignment :: FlagName -> FlagAssignment -> Maybe Bool Source #

Lookup the value for a flag

Returns Nothing if the flag isn't contained in the FlagAssignment .

Since: 2.2.0

insertFlagAssignment :: FlagName -> Bool -> FlagAssignment -> FlagAssignment Source #

Insert or update the boolean value of a flag.

If the flag is already present in the FlagAssigment , the value will be updated and the fact that multiple values have been provided for that flag will be recorded so that a warning can be generated later on.

Since: 2.2.0

diffFlagAssignment :: FlagAssignment -> FlagAssignment -> FlagAssignment Source #

Remove all flag-assignments from the first FlagAssignment that are contained in the second FlagAssignment

NB/TODO: This currently only removes flag assignments which also match the value assignment! We should review the code which uses this operation to figure out if this it's not enough to only compare the flagnames without the values.

Since: 2.2.0

findDuplicateFlagAssignments :: FlagAssignment -> [ FlagName ] Source #

Find the FlagName s that have been listed more than once.

Since: 2.2.0

showFlagValue :: ( FlagName , Bool ) -> String Source #

String representation of a flag-value pair.

dispFlagAssignment :: FlagAssignment -> Doc Source #

Pretty-prints a flag assignment.