Copyright | (c) 2014 Patrick Bahr, Emil Axelsson |
---|---|

License | BSD3 |

Maintainer | Patrick Bahr <paba@di.ku.dk> |

Stability | experimental |

Portability | non-portable (GHC Extensions) |

Safe Haskell | None |

Language | Haskell98 |

This module implements recursion schemes derived from attribute grammars.

- runAG :: forall f u d. Traversable f => Syn' f (u, d) u -> Inh' f (u, d) d -> (u -> d) -> Term f -> u
- runRewrite :: forall f g u d. (Traversable f, Functor g) => Syn' f (u, d) u -> Inh' f (u, d) d -> Rewrite f (u, d) g -> (u -> d) -> Term f -> (u, Term g)

# Documentation

:: forall f u d . Traversable f | |

=> Syn' f (u, d) u | semantic function of synthesised attributes |

-> Inh' f (u, d) d | semantic function of inherited attributes |

-> (u -> d) | initialisation of inherited attributes |

-> Term f | input term |

-> u |

This function runs an attribute grammar on a term. The result is the (combined) synthesised attribute at the root of the term.

:: forall f g u d . (Traversable f, Functor g) | |

=> Syn' f (u, d) u | |

-> Inh' f (u, d) d | semantic function of synthesised attributes |

-> Rewrite f (u, d) g | semantic function of inherited attributes |

-> (u -> d) | initialisation of inherited attributes |

-> Term f | input term |

-> (u, Term g) |

This function runs an attribute grammar with rewrite function on a term. The result is the (combined) synthesised attribute at the root of the term and the rewritten term.