Maintainer | bastiaan.heeren@ou.nl |
---|---|
Stability | provisional |
Portability | portable (depends on ghc) |
Safe Haskell | None |
Language | Haskell98 |
This module defines transformations. Given a term, a transformation returns a list of results (often a singleton list or the empty list).
- type Transformation a = Trans a a
- data Trans a b
- class MakeTrans f where
- transPure :: (a -> b) -> Trans a b
- transMaybe :: (a -> Maybe b) -> Trans a b
- transList :: (a -> [b]) -> Trans a b
- transEnvMonad :: (a -> EnvMonad b) -> Trans a b
- transRewrite :: RewriteRule a -> Trans a a
- transRef :: Typeable a => Ref a -> Trans a a
- transUseEnvironment :: Trans a b -> Trans (a, Environment) (b, Environment)
- transLiftView :: View a b -> Transformation b -> Transformation a
- transLiftViewIn :: View a (b, c) -> Transformation b -> Transformation a
- transLiftContext :: Transformation a -> Transformation (Context a)
- transLiftContextIn :: Transformation (a, Environment) -> Transformation (Context a)
- makeTransLiftContext :: MakeTrans f => (a -> f a) -> Transformation (Context a)
- makeTransLiftContext_ :: MakeTrans f => (a -> f ()) -> Transformation (Context a)
- transApply :: Trans a b -> a -> [(b, Environment)]
- transApplyWith :: Environment -> Trans a b -> a -> [(b, Environment)]
- getRewriteRules :: Trans a b -> [Some RewriteRule]
- isZeroTrans :: Trans a b -> Bool
Trans data type
type Transformation a = Trans a a 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.
transMaybe :: (a -> Maybe b) -> Trans a b Source
transEnvMonad :: (a -> EnvMonad b) -> Trans a b Source
transRewrite :: RewriteRule a -> Trans a a Source
Lifting transformations
transUseEnvironment :: Trans a b -> Trans (a, Environment) (b, Environment) Source
transLiftView :: View a b -> Transformation b -> Transformation a Source
transLiftViewIn :: View a (b, c) -> Transformation b -> Transformation a Source
transLiftContext :: Transformation a -> Transformation (Context a) Source
transLiftContextIn :: Transformation (a, Environment) -> Transformation (Context a) Source
makeTransLiftContext :: MakeTrans f => (a -> f a) -> Transformation (Context a) Source
Overloaded variant of transLiftContext
makeTransLiftContext_ :: MakeTrans f => (a -> f ()) -> Transformation (Context a) Source
Overloaded variant of transLiftContext
; ignores result
Using transformations
transApply :: Trans a b -> a -> [(b, Environment)] Source
transApplyWith :: Environment -> Trans a b -> a -> [(b, Environment)] Source
getRewriteRules :: Trans a b -> [Some RewriteRule] Source
isZeroTrans :: Trans a b -> Bool Source