Alloy: fast generic transformations for Haskell

  • Authors:
  • Neil C.C. Brown;Adam T. Sampson

  • Affiliations:
  • University of Kent, Canterbury, United Kingdom;University of Kent, Canterbury, United Kingdom

  • Venue:
  • Proceedings of the 2nd ACM SIGPLAN symposium on Haskell
  • Year:
  • 2009

Quantified Score

Hi-index 0.00

Visualization

Abstract

Data-type generic programming can be used to traverse and manipulate specific parts of large heterogeneously-typed tree structures, without the need for tedious boilerplate. Generic programming is often approached from a theoretical perspective, where the emphasis lies on the power of the representation rather than on efficiency. We describe use cases for a generic system derived from our work on a nanopass compiler, where efficiency is a real concern, and detail a new generics approach (Alloy) that we have developed in Haskell to allow our compiler passes to traverse the abstract syntax tree quickly. We benchmark our approach against several other Haskell generics approaches and statistically analyse the results, finding that Alloy is fastest on heterogeneously-typed trees.