Maintainer | bastiaan.heeren@ou.nl |
---|---|
Stability | provisional |
Portability | portable (depends on ghc) |
Safe Haskell | None |
Language | Haskell98 |
This module defines functions and operators for constructing and combining constraints.
Synopsis
- success :: Monad m => Constraint m a
- unknown :: Monad m => Constraint m a
- failure :: Monad m => Constraint m a
- exists1 :: Attribute -> Constraint EvBuilder [Attribute]
- exists :: [Attribute] -> Constraint EvBuilder [Attribute]
- existsF1 :: Attribute -> Constraint EvBuilder [Attribute]
- existsF :: [Attribute] -> Constraint EvBuilder [Attribute]
- implication :: [Attribute] -> [Attribute] -> Constraint EvBuilder [Attribute]
- negateConstraint :: Constraint EvBuilder [Attribute] -> Constraint EvBuilder [Attribute]
- (<||>) :: Constraint EvBuilder [Attribute] -> Constraint EvBuilder [Attribute] -> Constraint EvBuilder [Attribute]
- (<?>>) :: Constraint EvBuilder [Attribute] -> Constraint EvBuilder [Attribute] -> Constraint EvBuilder [Attribute]
- (<<?>) :: Constraint EvBuilder [Attribute] -> Constraint EvBuilder [Attribute] -> Constraint EvBuilder [Attribute]
- (==>) :: Constraint EvBuilder [Attribute] -> Constraint EvBuilder [Attribute] -> Constraint EvBuilder [Attribute]
- (<~>) :: Expr -> Expr -> Constraint EvBuilder a
Constructing constraints
success :: Monad m => Constraint m a Source #
Constraint with an always succesful predicate
unknown :: Monad m => Constraint m a Source #
Constraint whose predicate is always unknown
failure :: Monad m => Constraint m a Source #
Constraint whose predicate is always failure
exists1 :: Attribute -> Constraint EvBuilder [Attribute] Source #
If the attribute is present the constraint holds
otherwise we do not know
exists :: [Attribute] -> Constraint EvBuilder [Attribute] Source #
If all attributes are present the constraint holds
otherwise we do not know
existsF1 :: Attribute -> Constraint EvBuilder [Attribute] Source #
If the attribute is present the constraint holds
otherwise it does not
existsF :: [Attribute] -> Constraint EvBuilder [Attribute] Source #
If all attributes are present the constraint holds
otherwise it does not
:: [Attribute] | Hypotheses |
-> [Attribute] | Conclusions |
-> Constraint EvBuilder [Attribute] |
If all hypotheses are present and all conclusions are present then the constraint holds
If all hypotheses are present, but not all conclusions are present then the constraint does not hold
If not all hypotheses are present then we do not know
Combinators
negateConstraint :: Constraint EvBuilder [Attribute] -> Constraint EvBuilder [Attribute] Source #
Negate the results of the predicate within a constraint.
(<||>) :: Constraint EvBuilder [Attribute] -> Constraint EvBuilder [Attribute] -> Constraint EvBuilder [Attribute] Source #
(<?>>) :: Constraint EvBuilder [Attribute] -> Constraint EvBuilder [Attribute] -> Constraint EvBuilder [Attribute] Source #
If the first constraint is unknown then we return the result of the second constraint
(<<?>) :: Constraint EvBuilder [Attribute] -> Constraint EvBuilder [Attribute] -> Constraint EvBuilder [Attribute] Source #
If the second constraint is unknown then we return the result of the first constraint
(==>) :: Constraint EvBuilder [Attribute] -> Constraint EvBuilder [Attribute] -> Constraint EvBuilder [Attribute] Source #
Implication over constraints
If the first constraint holds then the result of this operation is equal to that of the second constraint
otherwise we do not know whether this constraint holds