Defined in abbott2004-containers. Way of representing strictly positive types, and for generic programming. It provides semantics for inductive families of types.
Kinds
Unary Containers
Unary containers have signatures .
-ary Containers
An -ary container is made from a .
Indexed Containers
An indexed container is a functor of type,
Where is an indexed family of sets, AKA a comma category in .
TODO: Check this.
Generalized Containers
Generalized containers act as functors from an arbitrary category to They can be parameterized as polynomial functors into a ‘shape’ part and a ‘position’ part:
S : Set
P : S -> Set
Containers are a special case of polynomial functors. Containers act semantically as polynomial functors: Note, it is supposed to be , not , as some texts use. This can be seen when written in exponential notation as:
Operations
Coproducts
All containers are closed under coproduct.
Let be containers. Then
Products
Unary, nary and indexed all have products In the generalised case, the category must have infinite coproducts to have closed under infinite products. damato2025-container-thesis (1.5.5)
Composition
Unary, nary and indexed all have products. It does not make sense to talk about composition of generalized containers.
Exponentiation
Equally all containers are closed under exponentiation. That is, for a pair of contianers , , the type of container homomorphisms can be represented interally as,
Properties
Construction
A type may have its extension taken (), or it may instead be passed to a fixpoint operator, such as W, to get an inductive tree, or M to get a coinductive tree, in both cases, the type is equal to its extension:
This resulting objects has itself as its ‘payload’. is a fully faithful functor
Container morphisms
container homomorphisms are precisely natural transformations under .
Examples
Empty Container
The empty container has no shapes.
Constant Container
A constant container ignores and produces a constant shape , where positions are empty for all in .
Identity Container
Maybe Container
Simple Product Container
MaybeProd Container
Square Container
MaybeSquare Container
List Container
CoList Container
Stream Container
Category theoretic perspective
Containers are presented as constructions in the internal language of Locally Cartesian Closed Category Initial Algebra is W Types Terminal coalgebra of a container is an M type.
Remarks
fiore2022-quotient-inductive refers to this as a signature. It is unclear where that terminology arises form.
References
damato2025-formalizing-containers Chapter 1 - overall survey. abbott2004-containers
# Duplicate Content 1
Defined in [[abbott2004-containers]]. Way of representing [[strictly positive types]].
S : Set P : S → Set
Containers act semantically as polynomial functors:
$(S\triangleleft P) X = \Sigma s:S. P s \to X$
[[Initial algebra]] is [[W Type|W Types]]
Container
[[Terminal coalgebra]] of a container is an [[M type]].
Coniductive principle: if you have a bisimulation on streams
## References
[[damato2025-formalizing-containers]]
[[abbott2004-containers]]