Skip to main content
    • Aa
    • Aa
  • Get access
    Check if you have access via personal or institutional login
  • Cited by 2
  • Cited by
    This article has been cited by the following publications. This list is generated based on data provided by CrossRef.

    Olmer, Tim Heeren, Bastiaan and Jeuring, Johan 2014. Evaluating Haskell expressions in a tutoring environment. Electronic Proceedings in Theoretical Computer Science, Vol. 170, p. 50.

    Magalhães, José Pedro and Löh, Andres 2012. A Formal Comparison of Approaches to Datatype-Generic Programming. Electronic Proceedings in Theoretical Computer Science, Vol. 76, p. 50.


A lightweight approach to datatype-generic rewriting

  • DOI:
  • Published online: 27 September 2010

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.

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.

P. Borovanský , C. Kirchner , H. Kirchner & C. Ringeissen (2001) Rewriting with strategies in ELAN: a functional semantics, Int. J. Found. Comput. Sci., 12 (1), 6995.

M. Bravenboer , K. T. Kalleberg & E. Visser (2008) Stratego/XT 0.17: a language and toolset for program transformation. Sci. Comput. Program., 72 (1–2), 5270.

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. Hinze , J. Jeuring & A. Löh (2004) Type-indexed data types, Sci. Comput. Program., 51 (2), 117151.

P. Jansson & J. Jeuring (1998) Polytypic unification, J. Funct. Program., 8 (5), 527536.

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? *