Portability | ghc |
---|---|

Stability | unstable |

Maintainer | Andy Gill <andygill@ku.edu> |

# Documentation

rewrite :: (Monoid dec, Monad m) => (exp1 -> RewriteM m dec exp1) -> Rewrite m dec exp1Source

`rewrite`

is our primitive way of building a Rewrite,
where if the rewrite is successful it is automatically marked as a non-identity rewrite.

`rewrite $ \ _ e -> return e`

*is not* an identity rewrite.

runRewrite :: (Monoid dec, Monad m) => Rewrite m dec exp -> dec -> exp -> m (Either String (exp, dec))Source

`runRewrite`

executes the rewrite, returning either a failure message,
or a success and the new parts of the environment.