GADTs, Functoriality, Parametricity: Pick Two

05/07/2021
by   Patricia Johann, et al.
0

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.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
02/13/2018

On the Relative Succinctness of Sentential Decision Diagrams

Sentential decision diagrams (SDDs) introduced by Darwiche in 2011 are a...
research
06/13/2018

Dependently Typed Folds for Nested Data Types

We present an approach to develop folds for nested data types using depe...
research
10/23/2017

Locally Nameless Permutation Types

We define "Locally Nameless Permutation Types", which fuse permutation t...
research
03/07/2018

The generalized stochastic preference choice model

We propose a new discrete choice model that generalizes the random utili...
research
03/26/2021

Categorical Representation Learning: Morphism is All You Need

We provide a construction for categorical representation learning and in...
research
07/30/2019

Compiling With Classical Connectives

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

Please sign up or login with your details

Forgot password? Click here to reset