
TL;DR
This paper introduces a novel syntactic machinery in Haskell for creating extensible algebraic data types, enabling flexible decoration of abstract syntax trees, with a focus on GHC's capabilities.
Contribution
It presents a complete syntactic machinery for extensible data types in Haskell, applicable to abstract syntax trees, and demonstrates its encoding within GHC.
Findings
The machinery can express all syntactically possible extensions.
It is implemented using existing GHC features.
The approach facilitates flexible syntax tree decoration.
Abstract
We study the notion of extensibility in functional data types, as a new approach to the problem of decorating abstract syntax trees with additional sets of information. We observed the need for such extensibility while redesigning the data types representing Haskell abstract syntax inside GHC. Specifically, we describe our approach to the tree-decoration problem using a novel syntactic machinery in Haskell for expressing extensible data types. We show that the syntactic machinery is complete in that it can express all the syntactically possible forms of extensions to algebraic data type declarations. Then, we describe an encoding of the syntactic machinery based on the existing features in Glasgow Haskell Compiler(GHC).
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsLogic, programming, and type systems · Digital Humanities and Scholarship · Advanced Database Systems and Queries
