Earlier, we said that containers describe data structures and the extension
is what makes the description take form as a type inside our programming language \secref{the-extension-of-containers}. For
now, we use the extension of container to define the last two operation on containers
▷ and ▶. The first one is well known and is called the “substitution product”, or
“container composition”, and allows one data definition to be embedded inside another.
Definition
The sequencing product of containers (A,Aˉ)⊳(B,Bˉ) is given by
((a,aˉ):Σ(a:A).Aˉ(a)→B,Σ(y:Aˉ(a)).Bˉ(aˉ(y)))
(▷) : Container -> Container -> Container(▷) a b = (x : Ex a b.request) !> (Σ (a.response x.ex1) (b.response . x.ex2))
We call this operation the “existential composition” because the backward part reads like
“there exists Aˉ such that Bˉ“.