• Home
  • Search
  • Foundations for structured programming with GADTs
  • Open Access IconOpen Access
  • Cite Icon65
  • https://doi.org/10.1145/1328438.1328475Copy DOI Icon

Foundations for structured programming with GADTs

  • Jan 7, 2008
  • Patricia Johann +1 more
Show More
  • Abstract
  • Literature Map
  • References
  • Citations
  • Similar Papers
Abstract

GADTs are at the cutting edge of functional programming and becomemore widely used every day. Nevertheless, the semantic foundations underlying GADTs are not well understood. In this paper we solve this problem by showing that the standard theory of data types as carriers of initial algebras of functors can be extended from algebraic and nested data types to GADTs. We then use this observation to derivean initial algebra semantics for GADTs, thus ensuring that all of the accumulated knowledge about initial algebras can be brought to bear on them. Next, we use our initial algebra semantics for GADTs to derive expressive and principled tools --- analogous to the well-known and widely-used ones for algebraic and nested data types---for reasoning about, programming with, and improving the performance of programs involving, GADTs; we christen such a collection of tools for a GADT an initial algebra package. Along the way, we give a constructive demonstration that every GADT can be reduced to one which uses only the equality GADT and existential quantification. Although other such reductions exist in the literature, ours is entirely local, is independent of any particular syntactic presentation of GADTs, and can be implemented in the host language, rather than existing solely as a metatheoretical artifact. The main technical ideas underlying our approach are (i) to modify the notion of a higher-order functor so that GADTs can be seen as carriers of initial algebras of higher-order functors, and (ii) to use left Kan extensions to trade arbitrary GADTs for simpler-but-equivalent ones for which initial algebra semantics can bederived.

Similar Papers
  • Research Article
  • Citations11

Explicit substitutions and higher-order syntax

  • Sep 01, 2006
  • Higher-Order and Symbolic Computation
  • Neil Ghani +2
  • Book Chapter
  • Citations5

The integration of logical and algebraic types

  • Jan 01, 1989
  • John W Gray
  • Book Chapter
  • Citations11

Indexed Induction and Coinduction, Fibrationally

  • Jan 01, 2011
  • Clément Fumex +2
  • Research Article
  • Citations38

The completeness of the algebraic specification methods for computable data types

  • Sep 01, 1982
  • Information and Control
  • J.A Bergstra +1
  • Book Chapter
  • Citations3

Type extensibility of a knowledge representation system with powersets

  • Jan 01, 1997
  • Cécile Capponi
  • Book Chapter
  • Citations10

Coalgebras as Types Determined by Their Elimination Rules

  • Jan 01, 2012
  • Anton Setzer
  • Book Chapter
  • Citations3

Proof by Consistency

  • Jan 01, 1991
  • Leo Bachmair
  • Book Chapter
  • Citations7

Programs as Transformations of Algebraic Theories (Extended Abstract)

  • Jan 01, 1981
  • Harald Ganzinger
  • Book Chapter
  • Citations1

10 - Numeric Data Types

  • Oct 28, 2010
  • Joe Celko's SQL for Smarties
  • Joe Celko
  • Book Chapter
  • Citations37

Indexed Induction-Recursion

  • Jan 01, 2001
  • Peter Dybjer +1
  • Book Chapter
  • Citations4

Algebraic specifications for parametrized data types with minimal parameter and target algebras

  • Jan 01, 1982
  • J A Bergstra +1
  • Book Chapter
  • Citations15

An algebraic view of structural induction

  • Jan 01, 1995
  • Claudio Hermida +1
  • Book Chapter
  • Citations34

A General Inductive Completion Algorithm and Application to Abstract Data Types

  • Jan 01, 1984
  • Helene Kirchner
  • Book Chapter
  • Citations3

Towards a Language for Defining Reusable Programming Language Components

  • Jan 01, 2022
  • Cas Van Der Rest +1
  • Conference Article
  • Citations11

Algebraic data types for language-integrated queries

  • Jan 22, 2013
  • George Giorgidze +3
Cactus Communications logo

Copyright 2026 Cactus Communications. All rights reserved.