|Cabal-184.108.40.206: A framework for packaging Haskell software||Contents||Index|
|Maintainer||Isaac Jones <firstname.lastname@example.org>|
|data Flag |
|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.
|data ConfVar |
|A ConfVar represents the variable type used.
|data Condition c|
|A boolean expression parameterized over the variable type used.
|parseCondition :: ReadP r (Condition ConfVar)|
|Parse a configuration condition from a string.
|:: Condition c|
|-> (c -> Either d Bool)||(partial) variable assignment
|-> (Condition d, [d])|
|Simplify the condition and return its free variables.
|data CondTree v c a|
|ppCondTree :: Show v => CondTree v c a -> (c -> Doc) -> Doc|
|mapTreeData :: (a -> b) -> CondTree v c a -> CondTree v c b|
|:: Monoid a|
|=> [(String, [Bool])]||Domain for each flag name, will be tested in order.
|-> String||OS name, as returned by System.Info.os
|-> String||arch name, as returned by System.Info.arch
|-> (String, Version)||Compiler name + version
|-> [CondTree ConfVar [d] a]|
|-> ([d] -> DepTestRslt [d])||Dependency test function.
|-> Either [d] ([a], [d], [(String, Bool)])|
Try to find a flag assignment that satisfies the constaints of all trees.
Returns either the missing dependencies, or a tuple containing the
resulting data, the associated dependencies, and the chosen flag
In case of failure, the _smallest_ number of of missing dependencies is
returned. [XXX: Could also be specified with a function argument.]
XXX: The current algorithm is rather naive. A better approach would be to:
- Rule out possible paths, by taking a look at the associated dependencies.
- Infer the required values for the conditions of these paths, and
calculate the required domains for the variables used in these
conditions. Then picking a flag assignment would be linear (I guess).
This would require some sort of SAT solving, though, thus it's not
implemented unless we really need it.
|ignoreConditions :: (Monoid a, Monoid c) => CondTree v c a -> (a, c)|
|Flatten a CondTree. This will resolve the CondTree by taking all
possible paths into account. Note that since branches represent exclusive
choices this may not result in a "sane" result.
|data DepTestRslt d|
|Result of dependency test. Isomorphic to Maybe d but renamed for
|Produced by Haddock version 0.8|