Safe Haskell  None 

Apply rewrite rules.
 data RewriteRule a n = RewriteRule {
 ruleBinds :: [(BindMode, Bind n)]
 ruleConstraints :: [Type n]
 ruleLeft :: Exp a n
 ruleLeftHole :: Maybe (Exp a n)
 ruleRight :: Exp a n
 ruleWeakEff :: Maybe (Effect n)
 ruleWeakClo :: [Exp a n]
 ruleFreeVars :: [Bound n]
 rewriteModule :: (Show a, Show n, Ord n, Pretty n) => [NamedRewriteRule a n] > Module a n > Module a n
 rewriteX :: (Show a, Show n, Ord n, Pretty n) => [NamedRewriteRule a n] > Exp a n > TransformResult (Exp a n)
Documentation
data RewriteRule a n Source
A rewrite rule. For example:
RULE [r1 r2 r3 : %] (x : Int r1) . addInt [:r1 r2 r3:] x (0 [r2] () = copyInt [:r1 r3:] x
RewriteRule  

Reannotate RewriteRule  Allow the expressions and anything else with annotations to be reannotated 
(Eq a, Eq n) => Eq (RewriteRule a n)  
(Show a, Show n) => Show (RewriteRule a n)  
(Pretty n, Eq n) => Pretty (RewriteRule a n) 
:: (Show a, Show n, Ord n, Pretty n)  
=> [NamedRewriteRule a n]  Rewrite rule database. 
> Module a n  Rewrite in this module. 
> Module a n 
Apply rewrite rules to a module.
:: (Show a, Show n, Ord n, Pretty n)  
=> [NamedRewriteRule a n]  Rewrite rules database. 
> Exp a n  Rewrite in this expression. 
> TransformResult (Exp a n) 
Perform rewrites topdown, repeatedly.