This report describes a system that was originally written to describe static semantic constraints over an abstract syntax tree. In the process several modules were developed that are of independent interest. These include the ability to attach annotations to a pre-existing data type, and writing Haskell style patterns as a first class object.
This report begins by describing the framework for annotations and the use of a modified version of the |Generics| library to manipulate those annotations. A system for pre-calculating the symbol table for every node in an abstract syntax tree is developed. How annotations can be used to describe first class patterns and performing matching between patterns and the symbol table annotations is shown. Finally, all these are used together to develop a domain specific embedded language for describing static semantic constraints.
The representation of constraints, annotations and first class patterns over arbitrary data types in Haskell. Honors Undergraduate Research, University of Kansas, May 2004.
.@misc{adams2004representation, author = {Adams, Michael D.}, title = {The Representation of Constraints, Annotations and First Class Patterns over Arbitrary Data Types in {Haskell}}, howpublished = {Honors Undergraduate Research, University of Kansas}, year = {2004}, month = may, }