ideas-1.7: Feedback services for intelligent tutoring systems

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

Ideas.Common.Rule.Transformation

Contents

Description

This module defines transformations. Given a term, a transformation returns a list of results (often a singleton list or the empty list).

Synopsis

Trans data type

data Trans a b Source #

Instances

Arrow Trans Source # 

Methods

arr :: (b -> c) -> Trans b c #

first :: Trans b c -> Trans (b, d) (c, d) #

second :: Trans b c -> Trans (d, b) (d, c) #

(***) :: Trans b c -> Trans b' c' -> Trans (b, b') (c, c') #

(&&&) :: Trans b c -> Trans b c' -> Trans b (c, c') #

ArrowZero Trans Source # 

Methods

zeroArrow :: Trans b c #

ArrowPlus Trans Source # 

Methods

(<+>) :: Trans b c -> Trans b c -> Trans b c #

ArrowChoice Trans Source # 

Methods

left :: Trans b c -> Trans (Either b d) (Either c d) #

right :: Trans b c -> Trans (Either d b) (Either d c) #

(+++) :: Trans b c -> Trans b' c' -> Trans (Either b b') (Either c c') #

(|||) :: Trans b d -> Trans c d -> Trans (Either b c) d #

Functor (Trans a) Source # 

Methods

fmap :: (a -> b) -> Trans a a -> Trans a b #

(<$) :: a -> Trans a b -> Trans a a #

Applicative (Trans a) Source # 

Methods

pure :: a -> Trans a a #

(<*>) :: Trans a (a -> b) -> Trans a a -> Trans a b #

liftA2 :: (a -> b -> c) -> Trans a a -> Trans a b -> Trans a c #

(*>) :: Trans a a -> Trans a b -> Trans a b #

(<*) :: Trans a a -> Trans a b -> Trans a a #

Alternative (Trans a) Source # 

Methods

empty :: Trans a a #

(<|>) :: Trans a a -> Trans a a -> Trans a a #

some :: Trans a a -> Trans a [a] #

many :: Trans a a -> Trans a [a] #

Category * Trans Source # 

Methods

id :: cat a a #

(.) :: cat b c -> cat a b -> cat a c #

Semigroup (Trans a b) Source # 

Methods

(<>) :: Trans a b -> Trans a b -> Trans a b #

sconcat :: NonEmpty (Trans a b) -> Trans a b #

stimes :: Integral b => b -> Trans a b -> Trans a b #

Monoid (Trans a b) Source # 

Methods

mempty :: Trans a b #

mappend :: Trans a b -> Trans a b -> Trans a b #

mconcat :: [Trans a b] -> Trans a b #

HasRefs (Trans a b) Source # 

Methods

getRefs :: Trans a b -> [Some Ref] Source #

allRefs :: Trans a b -> [Some Ref] Source #

getRefIds :: Trans a b -> [Id] Source #

Constructor functions

class MakeTrans f where Source #

A type class for constructing a transformation. If possible, makeTrans should be used. Use specialized constructor functions for disambiguation.

Minimal complete definition

makeTrans

Methods

makeTrans :: (a -> f b) -> Trans a b Source #

Instances

MakeTrans [] Source # 

Methods

makeTrans :: (a -> [b]) -> Trans a b Source #

MakeTrans Maybe Source # 

Methods

makeTrans :: (a -> Maybe b) -> Trans a b Source #

transPure :: (a -> b) -> Trans a b Source #

transMaybe :: (a -> Maybe b) -> Trans a b Source #

transList :: (a -> [b]) -> Trans a b Source #

transGuard :: (a -> Bool) -> Trans a a Source #

Reading and writing (with references)

readRef :: Ref a -> Trans x a Source #

readRefDefault :: a -> Ref a -> Trans x a Source #

writeRef :: Ref a -> Trans a a Source #

writeRef_ :: Ref a -> Trans a () Source #

Lifting transformations

Using transformations

transApply :: Trans a b -> a -> [(b, Environment)] Source #