DeepAI AI Chat
Log In Sign Up

GADTs, Functoriality, Parametricity: Pick Two

by   Patricia Johann, et al.

GADTs can be represented either as their Church encodings à la Atkey, or as fixpoints à 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.


page 1

page 2

page 3

page 4


On the Relative Succinctness of Sentential Decision Diagrams

Sentential decision diagrams (SDDs) introduced by Darwiche in 2011 are a...

Dependently Typed Folds for Nested Data Types

We present an approach to develop folds for nested data types using depe...

Locally Nameless Permutation Types

We define "Locally Nameless Permutation Types", which fuse permutation t...

The generalized stochastic preference choice model

We propose a new discrete choice model that generalizes the random utili...

Categorical Representation Learning: Morphism is All You Need

We provide a construction for categorical representation learning and in...

Compiling With Classical Connectives

The study of polarity in computation has revealed that an "ideal" progra...

Data-Codata Symmetry and its Interaction with Evaluation Order

Data types and codata types are, as the names suggest, often seen as dua...