ideas-1.8: 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 # 
Instance details

Defined in Ideas.Common.Rule.Transformation

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 # 
Instance details

Defined in Ideas.Common.Rule.Transformation

Methods

zeroArrow :: Trans b c #

ArrowPlus Trans Source # 
Instance details

Defined in Ideas.Common.Rule.Transformation

Methods

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

ArrowChoice Trans Source # 
Instance details

Defined in Ideas.Common.Rule.Transformation

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 # 
Instance details

Defined in Ideas.Common.Rule.Transformation

Methods

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

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

Applicative (Trans a) Source # 
Instance details

Defined in Ideas.Common.Rule.Transformation

Methods

pure :: a0 -> Trans a a0 #

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

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

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

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

Alternative (Trans a) Source # 
Instance details

Defined in Ideas.Common.Rule.Transformation

Methods

empty :: Trans a a0 #

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

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

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

Category Trans Source # 
Instance details

Defined in Ideas.Common.Rule.Transformation

Methods

id :: Trans a a #

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

Semigroup (Trans a b) Source # 
Instance details

Defined in Ideas.Common.Rule.Transformation

Methods

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

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

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

Monoid (Trans a b) Source # 
Instance details

Defined in Ideas.Common.Rule.Transformation

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 # 
Instance details

Defined in Ideas.Common.Rule.Transformation

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 # 
Instance details

Defined in Ideas.Common.Rule.Transformation

Methods

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

MakeTrans Maybe Source # 
Instance details

Defined in Ideas.Common.Rule.Transformation

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 #