ideas-1.3.1: Feedback services for intelligent tutoring systems

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

Ideas.Common.Rewriting.Term

Contents

Description

A simple data type for term rewriting

Synopsis

Symbols

Terms

class IsTerm a where Source

Methods

toTerm :: a -> Term Source

fromTerm :: MonadPlus m => Term -> m a Source

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

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

Functions and symbols

class WithFunctions a where Source

Minimal complete definition

function, getFunction

Methods

symbol :: Symbol -> a Source

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

getSymbol :: Monad m => a -> m Symbol Source

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

Instances

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

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

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

ternary :: WithFunctions a => Symbol -> a -> a -> a -> a Source

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

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

Variables

class WithVars a where Source

Methods

variable :: String -> a Source

getVariable :: Monad m => a -> m String Source

Instances

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

hasVar :: (Uniplate a, WithVars a) => String -> a -> Bool Source

Meta variables

class WithMetaVars a where Source

Methods

metaVar :: Int -> a Source

getMetaVar :: Monad m => a -> m Int Source

Instances