Affiliation:
1. Chalmers University of Technology, Gothenburg, Sweden
Abstract
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.
Publisher
Association for Computing Machinery (ACM)
Subject
Computer Graphics and Computer-Aided Design,Software
Cited by
5 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Modular reifiable matching: a list-of-functors approach to two-level types;Proceedings of the 2015 ACM SIGPLAN Symposium on Haskell;2015-08-30
2. How functional programming mattered;National Science Review;2015-07-13
3. Self-Representation in Girard's System U;ACM SIGPLAN Notices;2015-05-11
4. Self-Representation in Girard's System U;Proceedings of the 42nd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages;2015-01-14
5. Simple and compositional reification of monadic embedded languages;ACM SIGPLAN Notices;2013-11-12