Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Control.Coverage.Internal
Description
Module for internal representation.
- type Name = String
- type Binders lit = [Binder lit]
- data Binder lit
- newtype Environment = Environment {}
- makeEnv :: (Name -> Maybe [Name]) -> Environment
- defaultEnv :: Environment
- data Guard
- type Alternative lit = (Binders lit, Maybe Guard)
- data Redundant a
- = DontKnow
- | NotRedundant
- | Redundant a
- data Check lit = Check {
- getUncovered :: [Binders lit]
- getRedundant :: Redundant [Binders lit]
- makeCheck :: [Binders lit] -> Redundant [Binders lit] -> Check lit
- applyUncovered :: ([Binders lit] -> [Binders lit]) -> Check lit -> Check lit
- applyRedundant :: (Redundant [Binders lit] -> Redundant [Binders lit]) -> Check lit -> Check lit
- wildcard :: Binder lit
- genericMerge :: Ord a => (a -> Maybe b -> Maybe c -> d) -> [(a, b)] -> [(a, c)] -> [d]
- missingSingle :: Eq lit => Environment -> Binder lit -> Binder lit -> ([Binder lit], Maybe Bool)
- initialize :: Int -> [Binder lit]
- missingMultiple :: Eq lit => Environment -> Binders lit -> Binders lit -> ([Binders lit], Maybe Bool)
- missingCases :: Eq lit => Environment -> Binders lit -> Alternative lit -> ([Binders lit], Maybe Bool)
- missingAlternative :: Eq lit => Environment -> Alternative lit -> Binders lit -> ([Binders lit], Maybe Bool)
Documentation
type Binders lit = [Binder lit] Source
A collection of binders, as used to match products, in product binders or collections of binders in top-level declarations.
Binders
newtype Environment Source
Environment
The language implementor should provide an environment to let the checker lookup for constructors' names (just for one type for now).
Constructors
Environment | |
Guards and alternatives
Guard are abstract, and it is up to the language implementor to interpret guards abstractly. Guards can catch all cases, or represent some opaque expression which cannot be analysed.
type Alternative lit = (Binders lit, Maybe Guard) Source
A case alternative consists of a collection of binders which match a collection of values, and an optional guard.
Data-type for redundant cases representation.
Constructors
DontKnow | |
NotRedundant | |
Redundant a |
Check wraps both uncovered and redundant cases.
Constructors
Check | |
Fields
|
applyRedundant :: (Redundant [Binders lit] -> Redundant [Binders lit]) -> Check lit -> Check lit Source
genericMerge :: Ord a => (a -> Maybe b -> Maybe c -> d) -> [(a, b)] -> [(a, c)] -> [d] Source
Applies a function over two lists of tuples that may lack elements.
missingSingle :: Eq lit => Environment -> Binder lit -> Binder lit -> ([Binder lit], Maybe Bool) Source
Returns the uncovered set after one binder is applied to the set of values represented by another.
initialize :: Int -> [Binder lit] Source
Generates a list of initial binders.
missingMultiple :: Eq lit => Environment -> Binders lit -> Binders lit -> ([Binders lit], Maybe Bool) Source
missingMultiple
returns the whole set of uncovered cases.
missingCases :: Eq lit => Environment -> Binders lit -> Alternative lit -> ([Binders lit], Maybe Bool) Source
missingCases
applies missingMultiple
to an alternative.
missingAlternative :: Eq lit => Environment -> Alternative lit -> Binders lit -> ([Binders lit], Maybe Bool) Source
missingAlternative
is missingCases
with guard handling.