Containers are a way of constructing strictly positive types.

Abstract

We introduce the notion of a Martin-Lof category — a locally cartesian closed category with disjoint Coproduct (Category Theory) and Initial algebras of container functors (the categorical analogue of W Type) — and then establish that nested strictly positive inductive and coinductive types, which we call strictly positive types, exist in any Martin-Lof category. Central to our development are the notions of containers and container functors, introduced in Abbott, Altenkirch, and Ghani (2003a). These provide a new conceptual analysis of data structures and polymorphic functions by exploiting dependent type theory as a convenient way to define constructions in Martin-Lof category. We also show that morphisms between containers can be full and faithfully interpreted as polymorphic functions (i.e. natural transformations) and that, in the presence of W-types, all strictly positive types (including nested inductive and coinductive types) give rise to containers.