 
Summary: Categories of Containers
Michael Abbott1, Thorsten Altenkirch2, and Neil Ghani1
1 Department of Mathematics and Computer Science, University of Leicester
michael@araneidae.co.uk,ng13@mcs.le.ac.uk
2 School of Computer Science and Information Technology, Nottingham University
txa@cs.nott.ac.uk
Abstract. We introduce the notion of containers as a mathematical formalisation
of the idea that many important datatypes consist of templates where data is
stored. We show that containers have good closure properties under a variety of
constructions including the formation of initial algebras and final coalgebras. We
also show that containers include strictly positive types and shapely types but that
there are containers which do not correspond to either of these. Further, we derive
a representation result classifying the nature of polymorphic functions between
containers. We finish this paper with an application to the theory of shapely types
and refer to a forthcoming paper which applies this theory to differentiable types.
1 Introduction
Any element of the type List(X) of lists over X can be uniquely written as a natural
number n given by the length of the list, together with a function {1,...,n} X which
labels each position within the list with an element from X:
n:N , :{1..n} X .
