Skip to main content
×
Home
    • Aa
    • Aa

A lightweight approach to datatype-generic rewriting

  • THOMAS VAN NOORT (a1), ALEXEY RODRIGUEZ YAKUSHEV (a2), STEFAN HOLDERMANS (a2), JOHAN JEURING (a3), BASTIAAN HEEREN (a4) and JOSÉ PEDRO MAGALHÃES (a5)...
Abstract
Abstract

Term-rewriting systems can be expressed as generic programs parameterised over the shape of the terms being rewritten. Previous implementations of generic rewriting libraries require users to either adapt the datatypes that are used to describe these terms or to specify rewrite rules as functions. These are fundamental limitations: the former implies a lot of work for the user, while the latter makes it hard if not impossible to document, test, and analyze rewrite rules. In this article, we demonstrate how to overcome these limitations by making essential use of type-indexed datatypes. Our approach is lightweight in that it is entirely expressible in Haskell with GADTs and type families and can be readily packaged for use with contemporary Haskell distributions.

Copyright
Linked references
Hide All

This list contains references from the content that can be linked to their source. For a full set of references and notes please see the PDF or HTML where available.

A. van Deursen , J. Heering & P. Klint (eds). (1996) Language Prototyping. an Algebraic Specification Approach. AMAST Series in Computing, vol. 5. Singapore: World Scientific.

R. Lämmel & S. Peyton Jones (2003) Scrap your boilerplate: a practical design pattern for generic programming. In Proceedings of the ACM SIGPLAN Workshop on Types in Language Design and Implementation (TLDI 2003), New Orleans, LA, USA, January 18, 2003. ACM Press, pp. 2637.

E. Pasalić & N. Linger (2004) Meta-programming with typed object-language representations. In Generative Programming and Component Engineering: Third International Conference, GPCE 2004, Vancouver, Canada, October 24–28, 2004, Proceedings, G. Karsai & E. Visser (eds), Lecture Notes in Computer Science, vol. 3286. Springer-Verlag, pp. 136167.

Recommend this journal

Email your librarian or administrator to recommend adding this journal to your organisation's collection.

Journal of Functional Programming
  • ISSN: 0956-7968
  • EISSN: 1469-7653
  • URL: /core/journals/journal-of-functional-programming
Please enter your name
Please enter a valid email address
Who would you like to send this to? *
×