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 the recursion schemes from module
Data.Comp.PAG on Dag
s. In order to deal with the sharing present
in Dag
s, the recursion schemes additionally take an argument of
type d -> d -> d
that resolves clashing inherited attribute
values.
- runPAG :: forall f d u g. (Traversable f, Traversable d, Traversable g, Traversable u) => (forall a. d a -> d a -> d a) -> Syn' f (u :*: d) u g -> Inh' f (u :*: d) d g -> (forall a. u a -> d (Context g a)) -> Dag f -> u (Dag g)
Documentation
:: (Traversable f, Traversable d, Traversable g, Traversable u) | |
=> (forall a. d a -> d a -> d a) | resolution function for inherited attributes |
-> Syn' f (u :*: d) u g | semantic function of synthesised attributes |
-> Inh' f (u :*: d) d g | semantic function of inherited attributes |
-> (forall a. u a -> d (Context g a)) | initialisation of inherited attributes |
-> Dag f | input term |
-> u (Dag g) |
This function runs an attribute grammar on a dag. The result is the (combined) synthesised attribute at the root of the dag.