2012 · 22 citations · 17 references
ComputingComputer ScienceComputational LinguisticsProgramming LanguagesSyntaxAbstract Syntax TreesData TypesParsingSyntactic AnalysisSyntax AnalysisType SystemsAbstract Syntax ModelingAbstract Syntax Tree ConstructionAbstract Syntax Tree RepresentationConstructorsType Constructors
Representing a syntax tree using a data type often involves having many similar-looking constructors. Functions operating on such types often end up having many similar-looking cases. Different languages often make use of similar-looking constructions. We propose a generic model of abstract syntax trees capable of representing a wide range of typed languages. Syntactic constructs can be composed in a modular fashion enabling reuse of abstract syntax and syntactic processing within and across languages. Building on previous methods of encoding extensible data types in Haskell, our model is a pragmatic solution to Wadler's "expression problem". Its practicality has been confirmed by its use in the implementation of the embedded language Feldspar.
17
Per Bjesse, Koen Claessen, Mary Sheeran et al. · 1998 · 375 citations
Ralf Lämmel, Simon Peyton Jones · 2003 · 350 citations
Wouter Swierstra · Journal of Functional Programming · 2008 · 282 citations · Full text
Strongly typed heterogeneous collections
Oleg Kiselyov, Ralf Lämmel, Keean Schupke · 2004 · 183 citations