ideas-1.2: Feedback services for intelligent tutoring systems

Portabilityportable (depends on ghc)
Stabilityprovisional
Maintainerbastiaan.heeren@ou.nl
Safe HaskellNone

Ideas.Common.Rule.Abstract

Contents

Description

A rule is just a transformation with some meta-information, such as a name (which should be unique) and properties such as buggy or minor. Rules can be lifted with a view using the LiftView type class.

Synopsis

Rule data type and accessors

data Rule a Source

Abstract data type for representing rules

Constructor functions

makeRule :: (IsId n, MakeTrans f) => n -> (a -> f a) -> Rule aSource

ruleMaybe :: IsId n => n -> (a -> Maybe a) -> Rule aSource

ruleList :: IsId n => n -> (a -> [a]) -> Rule aSource

buggyRule :: (IsId n, MakeTrans f) => n -> (a -> f a) -> Rule aSource

minorRule :: (IsId n, MakeTrans f) => n -> (a -> f a) -> Rule aSource

rewriteRule :: (IsId n, RuleBuilder f a) => n -> f -> Rule aSource

rewriteRules :: (IsId n, RuleBuilder f a) => n -> [f] -> Rule aSource

Special minor rules

idRule :: IsId n => n -> Rule aSource

A special (minor) rule that always returns the identity

checkRule :: IsId n => n -> (a -> Bool) -> Rule aSource

A special (minor) rule that checks a predicate (and returns the identity if the predicate holds)

emptyRule :: IsId n => n -> Rule aSource

A special (minor) rule that is never applicable (i.e., this rule always fails)

Rule properties

siblingOf :: HasId b => b -> Rule a -> Rule aSource

doAfter :: (a -> a) -> Rule a -> Rule aSource

Perform the function after the rule has been fired

Recognizer

addRecognizerBool :: (a -> a -> Bool) -> Rule a -> Rule aSource

addTransRecognizer :: (a -> a -> Bool) -> Rule a -> Rule aSource

addRecognizerEnvMonad :: (a -> a -> EnvMonad ()) -> Rule a -> Rule aSource