A lightweight approach to datatype-generic rewriting

  • Authors:
  • Thomas Van noort;Alexey Rodriguez yakushev;Stefan Holdermans;Johan Jeuring;Bastiaan Heeren;JosÉ pedro MagalhÃes

  • Affiliations:
  • Institute for computing and information sciences, radboud university nijmegen, p.o. box 9010, 6500 gl nijmegen, the netherlands (e-mail: thomas@cs.ru.nl);Vector fabrics, paradijslaan 28, 5611 kn eindhoven, the netherlands (e-mail: alexey@vectorfabrics.com, stefan@vectorfabrics.com);Vector fabrics, paradijslaan 28, 5611 kn eindhoven, the netherlands (e-mail: alexey@vectorfabrics.com, stefan@vectorfabrics.com);Department of information and computing sciences, utrecht university, p.o. box 80.089, 3508 tb utrecht, the netherlands and school of computer science, open university of the netherlands, p.o. box ...;School of computer science, open university of the netherlands, p.o. box 2960, 6401 dl heerlen, the netherlands (e-mail: bastiaan.heeren@ou.nl);Department of information and computing sciences, utrecht university, p.o. box 80.089, 3508 tb utrecht, the netherlands (e-mail: jpm@cs.uu.nl)

  • Venue:
  • Journal of Functional Programming
  • Year:
  • 2010

Quantified Score

Hi-index 0.00

Visualization

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.