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).
Synopsis
- 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
- transGuard :: (a -> Bool) -> Trans a a
- transRewrite :: RewriteRule a -> Trans a a
- readRef :: Ref a -> Trans x a
- readRefDefault :: a -> Ref a -> Trans x a
- readRefMaybe :: Ref a -> Trans x (Maybe a)
- writeRef :: Ref a -> Trans a a
- writeRef_ :: Ref a -> Trans a ()
- writeRefMaybe :: Ref a -> Trans (Maybe 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)
- transApply :: Trans a b -> a -> [(b, Environment)]
- transApplyWith :: Environment -> Trans a b -> a -> [(b, Environment)]
- getRewriteRules :: Trans a b -> [Some RewriteRule]
Trans data type
type Transformation a = Trans a a Source #
Instances
Arrow Trans Source # | |
ArrowZero Trans Source # | |
Defined in Ideas.Common.Rule.Transformation | |
ArrowPlus Trans Source # | |
ArrowChoice Trans Source # | |
Functor (Trans a) Source # | |
Applicative (Trans a) Source # | |
Alternative (Trans a) Source # | |
Category Trans Source # | |
Semigroup (Trans a b) Source # | |
Monoid (Trans a b) Source # | |
HasRefs (Trans a b) 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 #
transGuard :: (a -> Bool) -> Trans a a Source #
transRewrite :: RewriteRule a -> Trans a a Source #
Reading and writing (with references)
readRefDefault :: a -> Ref a -> Trans x 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 #
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 #