In categories of containers by Abbott etc, Containers are used
as descriptions for data structures that carry values. The Maybe
type is one of them and can be described as a container using
the extension on containersEx : Container -> Type -> Type.
To define the Maybe container, we need to define a boolean predicate. This is nothing more than a dependent type that is indexed over a boolean value, and that is inhabited with a trivial value when the boolean is true.
public exportdata IsTrue : Bool -> Type where TT : IsTrue True
Using this predicate, we build the Maybe container by setting the shapes as Bool and the positions with our IsTrue predicate.
Definition
The maybe container is given by a boolean and a predicate that this boolean is valued to True.