Maintainer | bastiaan.heeren@ou.nl |
---|---|
Stability | provisional |
Portability | portable (depends on ghc) |
Safe Haskell | None |
Language | Haskell98 |
Constraints for constraint-based tutors
- data Constraint a
- makeConstraint :: IsId n => n -> (a -> Result ()) -> Constraint a
- isRelevant :: Constraint a -> a -> Bool
- isSatisfied :: Constraint a -> a -> Bool
- isViolated :: Constraint a -> a -> Maybe String
- getResult :: Constraint a -> a -> Result ()
- data Result a
- = Irrelevant
- | Error String
- | Ok a
- relevance :: Result a -> Result a
Documentation
data Constraint a Source #
LiftView Constraint Source # | |
Eq (Constraint a) Source # | |
Ord (Constraint a) Source # | |
Show (Constraint a) Source # | |
HasId (Constraint a) Source # | |
makeConstraint :: IsId n => n -> (a -> Result ()) -> Constraint a Source #
isRelevant :: Constraint a -> a -> Bool Source #
isSatisfied :: Constraint a -> a -> Bool Source #
Satisfaction condition
isViolated :: Constraint a -> a -> Maybe String Source #
Satisfaction condition
getResult :: Constraint a -> a -> Result () Source #