compdata-dags-0.2: Compositional Data Types on DAGs

Copyright(c) 2014 Patrick Bahr, Emil Axelsson
LicenseBSD3
MaintainerPatrick Bahr <paba@di.ku.dk>
Stabilityexperimental
Portabilitynon-portable (GHC Extensions)
Safe HaskellNone
LanguageHaskell98

Data.Comp.Dag.PAG

Description

This module implements the recursion schemes from module Data.Comp.PAG on Dags. In order to deal with the sharing present in Dags, the recursion schemes additionally take an argument of type d -> d -> d that resolves clashing inherited attribute values.

Synopsis

Documentation

runPAG Source

Arguments

:: (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.