A foundation for GADTs and inductive families: dependent polynomial functor approach

  • Authors:
  • Makoto Hamana;Marcelo Fiore

  • Affiliations:
  • Gunma University, Kiryu, Japan;Computer Laboratory, Cambridge, United Kingdom

  • Venue:
  • Proceedings of the seventh ACM SIGPLAN workshop on Generic programming
  • Year:
  • 2011

Quantified Score

Hi-index 0.00

Visualization

Abstract

Every Algebraic Datatype (ADT) is characterised as the initial algebra of a polynomial functor on sets. This paper extends the characterisation to the case of more advanced datatypes: Generalised Algebraic Datatypes (GADTs) and Inductive Families. Specifically, we show that GADTs and Inductive Families are characterised as initial algebras of dependent polynomial functors. The theoretical tool we use throughout is an abstract notion of polynomial between sets together with its associated general form of polynomial functor between categories of indexed sets introduced by Gambino and Hyland. In the context of ADTs, this fundamental result is the basis for various generic functional programming techniques. To establish the usefulness of our approach for such developments in the broader context of inductively defined dependent types, we apply the theory to construct zippers for Inductive Families.