ideas-1.7: Feedback services for intelligent tutoring systems

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

Ideas.Common.Derivation

Contents

Description

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

Synopsis

Data type

data Derivation s a Source #

Instances

BiFunctor Derivation Source # 

Methods

biMap :: (a -> c) -> (b -> d) -> Derivation a b -> Derivation c d Source #

mapFirst :: (a -> b) -> Derivation a c -> Derivation b c Source #

mapSecond :: (b -> c) -> Derivation a b -> Derivation a c Source #

Functor (Derivation s) Source # 

Methods

fmap :: (a -> b) -> Derivation s a -> Derivation s b #

(<$) :: a -> Derivation s b -> Derivation s a #

(Show s, Show a) => Show (Derivation s a) Source # 

Methods

showsPrec :: Int -> Derivation s a -> ShowS #

show :: Derivation s a -> String #

showList :: [Derivation s a] -> ShowS #

Constructing a derivation

prepend :: (a, s) -> Derivation s a -> Derivation s a Source #

extend :: Derivation s a -> (s, a) -> Derivation s a Source #

Querying a derivation

isEmpty :: Derivation s a -> Bool Source #

Tests whether the derivation is empty

derivationLength :: Derivation s a -> Int Source #

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

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

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