Early Announcement: Parametricity for GADTs

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Cagne, Pierre, Johann, Patricia
Format: Preprint
Publié: 2024
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866910680699895808
author Cagne, Pierre
Johann, Patricia
author_facet Cagne, Pierre
Johann, Patricia
contents Relational parametricity was first introduced by Reynolds for System F. Although System F provides a strong model for the type systems at the core of modern functional programming languages, it lacks features of daily programming practice such as complex data types. In order to reason parametrically about such objects, Reynolds' seminal ideas need to be generalized to extensions of System F. Here, we explore such a generalization for the extension of System F by Generalized Algebraic Data Types (GADTs) as found in Haskell. Although GADTs generalize Algebraic Data Types (ADTs) -- i.e., simple recursive types such as lists, trees, etc. -- we show that naively extending the parametric treatment of these recursive types is not enough to tackle GADTs. We propose a tentative workaround for this issue, borrowing ideas from the categorical semantics of GADTs known as (functorial) completion. We discuss some applications, as well as some limitations, of this solution.
format Preprint
id arxiv_https___arxiv_org_abs_2411_00589
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Early Announcement: Parametricity for GADTs
Cagne, Pierre
Johann, Patricia
Logic in Computer Science
Programming Languages
F.3.2; D.3.3
Relational parametricity was first introduced by Reynolds for System F. Although System F provides a strong model for the type systems at the core of modern functional programming languages, it lacks features of daily programming practice such as complex data types. In order to reason parametrically about such objects, Reynolds' seminal ideas need to be generalized to extensions of System F. Here, we explore such a generalization for the extension of System F by Generalized Algebraic Data Types (GADTs) as found in Haskell. Although GADTs generalize Algebraic Data Types (ADTs) -- i.e., simple recursive types such as lists, trees, etc. -- we show that naively extending the parametric treatment of these recursive types is not enough to tackle GADTs. We propose a tentative workaround for this issue, borrowing ideas from the categorical semantics of GADTs known as (functorial) completion. We discuss some applications, as well as some limitations, of this solution.
title Early Announcement: Parametricity for GADTs
topic Logic in Computer Science
Programming Languages
F.3.2; D.3.3
url https://arxiv.org/abs/2411.00589