Copyright | (C) 2012-2016, University of Twente |
---|---|

License | BSD2 (see the file LICENSE) |

Maintainer | Christiaan Baaij <christiaan.baaij@gmail.com> |

Safe Haskell | None |

Language | Haskell2010 |

Rewriting combinators and traversals

- allR :: forall m. (Functor m, Monad m, Fresh m) => Bool -> Transform m -> Transform m
- (>->) :: Monad m => Transform m -> Transform m -> Transform m
- (>-!->) :: Monad m => Transform m -> Transform m -> Transform m
- topdownR :: (Fresh m, Functor m, Monad m) => Transform m -> Transform m
- unsafeTopdownR :: (Fresh m, Functor m, Monad m) => Transform m -> Transform m
- bottomupR :: (Fresh m, Functor m, Monad m) => Transform m -> Transform m
- unsafeBottomupR :: (Fresh m, Functor m, Monad m) => Transform m -> Transform m
- (!->) :: Rewrite m -> Rewrite m -> Rewrite m
- (>-!) :: Rewrite m -> Rewrite m -> Rewrite m
- repeatR :: Rewrite m -> Rewrite m
- whenR :: Monad m => ([CoreContext] -> Term -> m Bool) -> Transform m -> Transform m
- bottomupWhenR :: (Monad m, Fresh m, Functor m) => ([CoreContext] -> Term -> m Bool) -> Transform m -> Transform m

# Documentation

:: (Functor m, Monad m, Fresh m) | |

=> Bool | Freshen variable references in abstracted terms |

-> Transform m | The transformation to apply to the subtrees |

-> Transform m |

Apply a transformation on the subtrees of an term

(>->) :: Monad m => Transform m -> Transform m -> Transform m infixr 6 Source

Apply two transformations in succession

(>-!->) :: Monad m => Transform m -> Transform m -> Transform m infixr 6 Source

Apply two transformations in succession, and perform a deepseq in between.

topdownR :: (Fresh m, Functor m, Monad m) => Transform m -> Transform m Source

Apply a transformation in a topdown traversal

unsafeTopdownR :: (Fresh m, Functor m, Monad m) => Transform m -> Transform m Source

Apply a transformation in a topdown traversal. Doesn't freshen bound variables

bottomupR :: (Fresh m, Functor m, Monad m) => Transform m -> Transform m Source

Apply a transformation in a bottomup traversal

unsafeBottomupR :: (Fresh m, Functor m, Monad m) => Transform m -> Transform m Source

Apply a transformation in a bottomup traversal. Doesn't freshen bound variables

(!->) :: Rewrite m -> Rewrite m -> Rewrite m infixr 5 Source

Only apply the second transformation if the first one succeeds.

(>-!) :: Rewrite m -> Rewrite m -> Rewrite m infixr 5 Source

Only apply the second transformation if the first one fails.

bottomupWhenR :: (Monad m, Fresh m, Functor m) => ([CoreContext] -> Term -> m Bool) -> Transform m -> Transform m Source

Only traverse downwards when the assertion evaluates to true