Prototyping Generic Programming using Template Haskell

Ulf Norell and Patrik Jansson. Prototyping Generic Programming using Template Haskell. In the proceedings of the Seventh International Conference on Mathematics of Program Construction, MPC 2004. Copyright © Springer-Verlag.
[implementation, slides, ps, pdf ]

Generic Programming deals with the construction of programs that can be applied to many different datatypes. This is achieved by parameterizing the generic programs by the structure of the datatypes on which they are to be applied. Programs that can be defined generically range from simple map functions through pretty printers to complex XML tools.

The design space of generic programming languages is largely unexplored, partly due to the time and effort required to implement such a language. In this paper we show how to write flexible prototype implementations of two existing generic programming languages, PolyP and Generic Haskell, using Template Haskell, an extension to Haskell that enables compile-time meta-programming. In doing this we also gain a better understanding of the differences and similarities between the two languages.


Valid HTML 4.01! Disclaimer
Last modified: Thu 13 Apr 2006 03:06:22 PM CEST