Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Functions for checking different parameter/value combinations.
Synopsis
- getSinglePVals :: [NamedParamMatch] -> [ParameterPattern] -> LogicI ([NamedParamMatch], [(String, Maybe String)])
- namedPMatches :: [NamedParamMatch] -> [(String, Maybe String)] -> [NamedParamMatch]
- pmatchCmp :: [NamedParamMatch] -> [NamedParamMatch] -> Ordering
- pmatchMax :: (a -> [NamedParamMatch]) -> a -> a -> a
- isCompatible :: [(String, Maybe String)] -> CandidateFile -> Bool
Documentation
getSinglePVals :: [NamedParamMatch] -> [ParameterPattern] -> LogicI ([NamedParamMatch], [(String, Maybe String)]) Source #
Return a value to use for each parameter in the pattern, retricting those values to the name parameter matches already established. This is a little more complicated because there could be parameter name duplicates in the already established matches (e.g. a matched file contains multiple values for a parameter), so the actual subset of the named parameter matches associated with this pattern selection is also returned.
namedPMatches :: [NamedParamMatch] -> [(String, Maybe String)] -> [NamedParamMatch] Source #
namedPMatches supplements the core set of named matches with the extended set of parameter values, marking all parameters not in the core set as Assumed or NotSpecified.
pmatchCmp :: [NamedParamMatch] -> [NamedParamMatch] -> Ordering Source #
This provides an Ordering result of comparing two sets of NamedParamMatch. This can be used for sorting or other prioritization of named matches.
pmatchMax :: (a -> [NamedParamMatch]) -> a -> a -> a Source #
Returns the maximum of two arguments based on comparing the [NamedParamMatch] extracted from each argument (via the passed function).
isCompatible :: [(String, Maybe String)] -> CandidateFile -> Bool Source #
isCompatible can be used as a filter predicate to determine if the specified file is compatible with the provided parameters and chosen parameter values. One principle compatibility check is ensuring that there is no *other* parameter value in the filename that conflicts with a chosen parameter value.