The Essence of Generalized Algebraic Data Types
Open Access
- 2 January 2024
- journal article
- research article
- Published by Association for Computing Machinery (ACM) in Proceedings of the ACM on Programming Languages
- Vol. 8 (POPL) , 695-723
Abstract
This paper considers direct encodings of generalized algebraic data types (GADTs) in a minimal suitable lambda-calculus. To this end, we develop an extension of System F ω with recursive types and internalized type equalities with injective constant type constructors. We show how GADTs and associated pattern-matching constructs can be directly expressed in the calculus, thus showing that it may be treated as a highly idealized modern functional programming language. We prove that the internalized type equalities in conjunction with injectivity rules increase the expressive power of the calculus by establishing a non-macro-expressibility result in F ω , and prove the system type-sound via a syntactic argument. Finally, we build two relational models of our calculus: a simple, unary model that illustrates a novel, two-stage interpretation technique, necessary to account for the equational constraints; and a more sophisticated, binary model that relaxes the construction to allow, for the first time, formal reasoning about data-abstraction in a calculus equipped with GADTs.Keywords
Funding Information
- Villum Fonden (25804)
- Marie Curie (101065303)
This publication has 31 references indexed in Scilit:
- System FC with explicit kind equality2013
- Logical Step-Indexed Logical RelationsLogical Methods in Computer Science, 2011
- Parametricity, type equality, and higher-order polymorphismJournal of Functional Programming, 2010
- Meta-programming With Built-in Type EqualityElectronic Notes in Theoretical Computer Science, 2008
- Inductive definitions in the system Coq rules and properties2005
- Modelling environments in call-by-value programming languagesInformation and Computation, 2003
- Nested datatypes1998
- A Syntactic Approach to Type SoundnessInformation and Computation, 1994
- Categorical data types in parametric polymorphismMathematical Structures in Computer Science, 1994
- On the expressive power of programming languagesScience of Computer Programming, 1991