ideas-1.3.1: Feedback services for intelligent tutoring systems

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

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 a Source

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

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

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

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

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

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

Special minor rules

idRule :: IsId n => n -> Rule a Source

A special (minor) rule that always returns the identity

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

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

emptyRule :: IsId n => n -> Rule a Source

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

Rule properties

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

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

Perform the function after the rule has been fired

Recognizer

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

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

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