ideas-1.1: Feedback services for intelligent tutoring systems

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

Ideas.Common.Rewriting.Term

Contents

Description

A simple data type for term rewriting

Synopsis

Symbols

Terms

class IsTerm a whereSource

Methods

toTerm :: a -> TermSource

fromTerm :: MonadPlus m => Term -> m aSource

fromTermM :: (Monad m, IsTerm a) => Term -> m aSource

fromTermWith :: (Monad m, IsTerm a) => (Symbol -> [a] -> m a) -> Term -> m aSource

Functions and symbols

class WithFunctions a whereSource

Methods

symbol :: Symbol -> aSource

function :: Symbol -> [a] -> aSource

getSymbol :: Monad m => a -> m SymbolSource

getFunction :: Monad m => a -> m (Symbol, [a])Source

Instances

isFunction :: (WithFunctions a, Monad m) => Symbol -> a -> m [a]Source

unary :: WithFunctions a => Symbol -> a -> aSource

binary :: WithFunctions a => Symbol -> a -> a -> aSource

isUnary :: (WithFunctions a, Monad m) => Symbol -> a -> m aSource

isBinary :: (WithFunctions a, Monad m) => Symbol -> a -> m (a, a)Source

Variables

class WithVars a whereSource

Methods

variable :: String -> aSource

getVariable :: Monad m => a -> m StringSource

Instances

vars :: (Uniplate a, WithVars a) => a -> [String]Source

Meta variables

class WithMetaVars a whereSource

Methods

metaVar :: Int -> aSource

getMetaVar :: Monad m => a -> m IntSource

Instances