Update Monads: Cointerpreting Directed Containers

Abstract

We introduce update monads as a generalization of state monads. Update
monads are the compatible compositions of reader and writer monads
given by a set and a monoid. Distributive laws between such monads are
given by actions of the monoid on the set.
We also discuss a dependently typed generalization of update monads. Unlike simple update monads, they cannot be factored into a reader and writer monad, but rather into similarly looking relative monads.
Dependently typed update monads arise from cointerpreting directed
containers, by which we mean an extension of an interpretation of the
opposite of the category of containers into the category of set
functors.