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.AG

Description

This module implements recursion schemes derived from attribute grammars.

Synopsis

Documentation

runAG Source

Arguments

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

runRewrite Source

Arguments

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