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? 



Comonads from monoids
This looks like a special case of the fact that given a monad $T$ whose underlying functor has a right adjoint, that right adjoint $C$ acquires a comonad structure (mated to the structure of the monad), and the category of $M$-algebras is equivalent to the category of $C$-coalgebras. (Here $T$ is $M \times -$, with right adjoint $(-)^M$.) 


This observation was first made by Eilenberg and Moore (*Adjoint functors and triples*, Illinois J. Math. 9, 3 (1965), 381-398). There is a little on this in the nLab [here](http://ncatlab.org/nlab/show/adjoint+monad). 


