ideas-1.6: Feedback services for intelligent tutoring systems

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

Ideas.Common.Context

Contents

Description

The Context datatype places a value in a context consisting of an environment with bindings and a point of focus. The datatype is an instance of the HasEnvironment type class (for accessing the environment) and the Navigator type class (for traversing the term).

Synopsis

Abstract data type

data Context a Source #

Abstract data type for a context: a context stores an envrionent.

newContext :: ContextNavigator a -> Context a Source #

Construct a context

fromContext :: Monad m => Context a -> m a Source #

fromContextWith :: Monad m => (a -> b) -> Context a -> m b Source #

fromContextWith2 :: Monad m => (a -> b -> c) -> Context a -> Context b -> m c Source #

Context navigator

Lifting

liftToContext :: LiftView f => f a -> f (Context a) Source #

Lift a rule to operate on a term in a context

use :: (LiftView f, IsTerm a, IsTerm b) => f a -> f (Context b) Source #

useC :: (LiftView f, IsTerm a, IsTerm b) => f (Context a) -> f (Context b) Source #

applyTop :: (a -> a) -> Context a -> Context a Source #

Apply a function at top-level. Afterwards, try to return the focus to the old position

changeInContext :: (a -> a) -> Context a -> Context a Source #