The following construction is probably known. I think it should work in any closed symmetric monoidal category, but I will play it safe and formulate the question in the concrete, cartesian closed setting.
Let $\mathcal C$ be a concrete, cartesian closed category. Let $(M,*,e)$ be a monoid in $\mathcal C$. There is a comonad $(T,\varepsilon,\sigma)$ on $C$ associated to $M$, given as follows:
- $T(X):=X^M$ ;
- $\varepsilon_X:X^M\to X$ is the value at the unit of $M$: $\varepsilon_X(f):=f(e)$ ;
- $\sigma_X:X^M\to {X^M}^M\simeq X^{M\times M}$ is the composition with the multiplication of $M$: $\sigma_X(f)(a,b)=f(a*b)$.
It seems that there are several interesting examples of comonads arising in this way, at least in the category of posets. For example, closure operators on posets arise from this construction as Eilenberg-Moore coalgebras (take $M$ to be the two-element semilattice).
What is the name of this construction and where can read more about it?