ideas-1.2: Feedback services for intelligent tutoring systems

Portabilityportable (depends on ghc)
Safe HaskellSafe-Inferred




Datatype for representing a derivation (parameterized both in the terms and the steps)


Data type

data Derivation s a Source


BiFunctor Derivation 
(Typed a t1, Typed a t2) => Typed a (Derivation t1 t2) 
Functor (Derivation s) 
(Show s, Show a) => Show (Derivation s a) 

Constructing a derivation

prepend :: (a, s) -> Derivation s a -> Derivation s aSource

extend :: Derivation s a -> (s, a) -> Derivation s aSource

Querying a derivation

isEmpty :: Derivation s a -> BoolSource

Tests whether the derivation is empty

derivationLength :: Derivation s a -> IntSource

Returns the number of steps in a derivation

terms :: Derivation s a -> [a]Source

All terms in a derivation

steps :: Derivation s a -> [s]Source

All steps in a derivation

triples :: Derivation s a -> [(a, s, a)]Source

The triples of a derivation, consisting of the before term, the step, and the after term.

updateSteps :: (a -> s -> a -> t) -> Derivation s a -> Derivation t aSource

derivationM :: Monad m => (s -> m ()) -> (a -> m ()) -> Derivation s a -> m ()Source

Apply a monadic function to each term, and to each step