Portability | portable (depends on ghc) |
---|---|
Stability | provisional |
Maintainer | bastiaan.heeren@ou.nl |
Safe Haskell | None |
A simple data type for term rewriting
- data Symbol
- newSymbol :: IsId a => a -> Symbol
- isAssociative :: Symbol -> Bool
- makeAssociative :: Symbol -> Symbol
- data Term
- class IsTerm a where
- termView :: IsTerm a => View Term a
- fromTermM :: (Monad m, IsTerm a) => Term -> m a
- fromTermWith :: (Monad m, IsTerm a) => (Symbol -> [a] -> m a) -> Term -> m a
- class WithFunctions a where
- isSymbol :: WithFunctions a => Symbol -> a -> Bool
- isFunction :: (WithFunctions a, Monad m) => Symbol -> a -> m [a]
- unary :: WithFunctions a => Symbol -> a -> a
- binary :: WithFunctions a => Symbol -> a -> a -> a
- isUnary :: (WithFunctions a, Monad m) => Symbol -> a -> m a
- isBinary :: (WithFunctions a, Monad m) => Symbol -> a -> m (a, a)
- class WithVars a where
- variable :: String -> a
- getVariable :: Monad m => a -> m String
- isVariable :: WithVars a => a -> Bool
- vars :: (Uniplate a, WithVars a) => a -> [String]
- varSet :: (Uniplate a, WithVars a) => a -> Set String
- hasVar :: (Uniplate a, WithVars a) => String -> a -> Bool
- withoutVar :: (Uniplate a, WithVars a) => String -> a -> Bool
- hasSomeVar :: (Uniplate a, WithVars a) => a -> Bool
- hasNoVar :: (Uniplate a, WithVars a) => a -> Bool
- variableView :: WithVars a => View a String
- class WithMetaVars a where
- metaVar :: Int -> a
- getMetaVar :: Monad m => a -> m Int
- isMetaVar :: WithMetaVars a => a -> Bool
- metaVars :: (Uniplate a, WithMetaVars a) => a -> [Int]
- metaVarSet :: (Uniplate a, WithMetaVars a) => a -> IntSet
- hasMetaVar :: (Uniplate a, WithMetaVars a) => Int -> a -> Bool
- nextMetaVar :: (Uniplate a, WithMetaVars a) => a -> Int
Symbols
isAssociative :: Symbol -> BoolSource
Terms
Functions and symbols
class WithFunctions a whereSource
isSymbol :: WithFunctions a => Symbol -> a -> BoolSource
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
isVariable :: WithVars a => a -> BoolSource
hasSomeVar :: (Uniplate a, WithVars a) => a -> BoolSource
variableView :: WithVars a => View a StringSource
Meta variables
class WithMetaVars a whereSource
isMetaVar :: WithMetaVars a => a -> BoolSource
metaVars :: (Uniplate a, WithMetaVars a) => a -> [Int]Source
metaVarSet :: (Uniplate a, WithMetaVars a) => a -> IntSetSource
hasMetaVar :: (Uniplate a, WithMetaVars a) => Int -> a -> BoolSource
nextMetaVar :: (Uniplate a, WithMetaVars a) => a -> IntSource