Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data GenericPackageDescription = GenericPackageDescription {
- packageDescription :: PackageDescription
- genPackageFlags :: [Flag]
- condLibrary :: Maybe (CondTree ConfVar [Dependency] Library)
- condSubLibraries :: [(UnqualComponentName, CondTree ConfVar [Dependency] Library)]
- condForeignLibs :: [(UnqualComponentName, CondTree ConfVar [Dependency] ForeignLib)]
- condExecutables :: [(UnqualComponentName, CondTree ConfVar [Dependency] Executable)]
- condTestSuites :: [(UnqualComponentName, CondTree ConfVar [Dependency] TestSuite)]
- condBenchmarks :: [(UnqualComponentName, CondTree ConfVar [Dependency] Benchmark)]
- data Flag = MkFlag {}
- emptyFlag :: FlagName -> Flag
- data FlagName
- mkFlagName :: String -> FlagName
- unFlagName :: FlagName -> String
- data FlagAssignment
- mkFlagAssignment :: [(FlagName, Bool)] -> FlagAssignment
- unFlagAssignment :: FlagAssignment -> [(FlagName, Bool)]
- lookupFlagAssignment :: FlagName -> FlagAssignment -> Maybe Bool
- insertFlagAssignment :: FlagName -> Bool -> FlagAssignment -> FlagAssignment
- diffFlagAssignment :: FlagAssignment -> FlagAssignment -> FlagAssignment
- nullFlagAssignment :: FlagAssignment -> Bool
- showFlagValue :: (FlagName, Bool) -> String
- dispFlagAssignment :: FlagAssignment -> Doc
- parseFlagAssignment :: ReadP r FlagAssignment
- parsecFlagAssignment :: ParsecParser FlagAssignment
- data ConfVar
Documentation
data GenericPackageDescription Source #
Instances
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.
MkFlag | |
|
Instances
Eq Flag # | |
Data Flag # | |
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 :: (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 # | |
Generic Flag # | |
Binary Flag # | |
type Rep Flag # | |
type Rep Flag = D1 (MetaData "Flag" "Distribution.Types.GenericPackageDescription" "Cabal-2.1.0.0" False) (C1 (MetaCons "MkFlag" PrefixI True) ((S1 (MetaSel (Just "flagName") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 FlagName) :*: S1 (MetaSel (Just "flagDescription") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String)) :*: (S1 (MetaSel (Just "flagDefault") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool) :*: S1 (MetaSel (Just "flagManual") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool)))) |
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
Eq FlagName # | |
Data FlagName # | |
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 :: (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 # | |
Read FlagName # | |
Show FlagName # | |
IsString FlagName # | Since: 2.0.0.2 |
fromString :: String -> FlagName Source # | |
Generic FlagName # | |
Binary FlagName # | |
Parsec FlagName # | |
Pretty FlagName # | |
Text FlagName # | |
type Rep FlagName # | |
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
mkFlagAssignment :: [(FlagName, Bool)] -> FlagAssignment Source #
Construct a FlagAssignment
from a list of flag/value pairs.
Since: 2.2.0
unFlagAssignment :: FlagAssignment -> [(FlagName, Bool)] Source #
Deconstruct a FlagAssignment
into a list of flag/value pairs.
(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.
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
nullFlagAssignment :: FlagAssignment -> Bool Source #
Test whether FlagAssignment
is empty.
Since: 2.2.0
dispFlagAssignment :: FlagAssignment -> Doc Source #
Pretty-prints a flag assignment.
parseFlagAssignment :: ReadP r FlagAssignment Source #
Parses a flag assignment.
parsecFlagAssignment :: ParsecParser FlagAssignment Source #
Parses a flag assignment.
A ConfVar
represents the variable type used.