nLab parameterized monad

Idea

A parameterized monad or indexed monad is the notion of monad that arises from an adjunction with a parameter. Recall that if F:S×CDF:S\times C\to D is a functor such that for every sSs\in S, the functor F(s,):CDF(s,-):C\to D has a right adjoint G s:DCG_s:D\to C, then there is a canonical way to make GG into a bifunctor G:S op×DCG:S^{op}\times D\to C.

Definition

Let SS and CC be categories.

A parameterized monad TT comprises:

  • a functor T:S op×S×CCT:S^{op}\times S\times C\to C;

  • a unit aT(s,s,a)a\to T(s,s,a) morphism in CC, extranatural in aa and ss;

  • a multiplication T(s 1,s 2,T(s 2,s 3,a))T(s 1,s 3,a)T(s_1,s_2,T(s_2,s_3,a))\to T(s_1,s_3,a), extranatural in aa and s 1,s 2,s 3s_1,s_2,s_3;

all satisfying analogues of the monad laws.

If CC has products then the parameterized monad might also be equipped with a strength, which is an extranatural family

a×T(s 1,s 2,b)T(s 1,s 2,a×b)a \times T(s_1,s_2,b)\to T(s_1,s_2,a\times b)

satisfying analogues of the strength laws.

Finally for modelling programming languages, one might require CC to be a cartesian closed category, but often a weaker requirement is that the “Kleisli exponentials” exist, which means the hom-objects of the form C(a,T(s 1,s 2,b))C(a,T(s_1,s_2,b)).

Examples

Parameterized state:

Let S=C=SetS=C=\mathbf{Set}, the category of sets. Then the parameterized state monad is given by

T(s 1,s 2,a)=(s 2×a) s 1 T(s_1,s_2,a)=(s_2\times a)^{s_1}

Parameterized continuations:

Let C=SetC=\mathbf{Set}, and let S=C opS=C^{op}. Then the parameterized continuation monad is given by

T(r 1,r 2,a)=[[a,r 2],r 1] T(r_1,r_2,a)=[[a,r_2],r_1]

writing [a,b][a,b] for the internal hom.

Connection with enriched categories

Let CC be a category with products. Let DD be enriched in CC with copowers. The definition of copower is that for any dDd \in D, the enriched hom-functor D(d,):DCD(d,-):D\to C has a left adjoint, (d):CD(-\bullet d):C\to D. This is an enriched adjunction with a parameter.

Let SS be a subcategory of DD. We can use this adjunction with parameter to define an SS-parameterized strong monad on CC:

T(s 1,s 2,c)=D(s 1,cs 2)T(s_1,s_2,c)=D(s_1,c\bullet s_2)

(which looks like an enriched version of the parameterized state monad).

In fact, every parameterized strong monad is of this form.

Theorem

Let CC be a category with products, and let SS be a category. The following data are equivalent:

  • A strong SS-parameterized monad on CC with Kleisli exponentials;

  • A category DD enriched in CC with copowers, having SS as a subcategory such that every object dd of DD is of the form d=csd=c\bullet s for cc in CC and ss in SS.

The proof from top to bottom constructs DD as the “parameterized Kleisli category” of TT.

References

The definitions were first spelt out in

The idea goes back further, for example,

  • Philip Wadler. Monads and composable continuations. Lisp and Symbolic Computation, 7(1):39–55, 1994.

A connection to graded monads is given in

A treatment of both graded monads and parameterized monads is given in

  • Soichiro Fujii, A 2-Categorical Study of Graded and Indexed Monads, (arXiv:1904.08083)

The connection to enriched categories is discussed in Section 9 of

Last revised on March 27, 2025 at 13:57:16. See the history of this page for a list of all contributions to it.