Journal of Functional Programming · 2010 · 22 citations · 22 references
ComputingComputer ScienceCompilersProgramming LanguagesSyntaxAbstract Syntax TreesData TypesData-flow AnalysisSyntactic AnalysisSyntax AnalysisType SystemsAbstract Syntax Tree RewritingBottom-up Rewrite SystemsGeneric FunctionsRewrite SystemsRewriting SystemsType-level Programming
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.
22
Koen Claessen, John Hughes · ACM SIGPLAN Notices · 2011 · 1K citations
Template meta-programming for Haskell
Tim Sheard, Simon Peyton Jones · 2002 · 548 citations
Ralf Lämmel, Simon Peyton Jones · 2003 · 350 citations
Simple unification-based type inference for GADTs
Simon Peyton Jones, Dimitrios Vytiniotis, Stephanie Weirich et al. · 2006 · 336 citations