GADTs, Functoriality, Parametricity: Pick Two
Patricia Johann (Appalachian State University), Enrico Ghiorzi, (Appalachian State University), Daniel Jeffries (Appalachian State, University)

TL;DR
This paper explores how different representations of GADTs influence the existence of parametric models in programming languages, impacting how these data types can be used and reasoned about.
Contribution
It demonstrates that the choice between Church encodings and fixpoint representations of GADTs determines the possibility of parametric models in supporting languages.
Findings
Church encoding GADTs may lack functorial map functions.
Fixpoint GADTs require functorial map functions for well-definedness.
Representation choice affects the programming and reasoning capabilities with GADTs.
Abstract
GADTs can be represented either as their Church encodings a la Atkey, or as fixpoints a la Johann and Polonsky. While a GADT represented as its Church encoding need not support a map function satisfying the functor laws, the fixpoint representation of a GADT must support such a map function even to be well-defined. The two representations of a GADT thus need not be the same in general. This observation forces a choice of representation of data types in languages supporting GADTs. In this paper we show that choosing whether to represent data types as their Church encodings or as fixpoints determines whether or not a language supporting GADTs can have parametric models. This choice thus has important consequences for how we can program with, and reason about, these advanced data types.
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.
