Monad instance for Monoid e => (,) e

Edward Kmett ekmett at
Thu Jul 25 19:14:09 CEST 2013

+1 to the spirit of is proposal if not the planned execution

I continue to be strongly in favor of adding this instance as it is a fundamental variant of the Writer Monad, and is analogous to the Monad/MonadReader instances for (->) e.

The tricky part is how to structure base so that it happens, as the context mentions Monoid, but Monoid which appears in the context isn't currently in the Prelude, yet Monad and the (,) data type are known to the Prelude. Orphaning it is less than ideal.

However, that seems to be resolving itself. Given the direction of the AMP and Foldable/Traversable changes that we're working towards for 7.10 and the attendant need to bring Monoid into the Prelude, that may be a good time to fix up this missing instance and expose it properly.

This way we don't have to bring that module full of orphans back to life.


On Jul 25, 2013, at 7:42 AM, Nathan van Doorn <nvd1234 at> wrote:

> This is a relatively simple instance, so I was surprised that I couldn't find it in base.
> My proposal is to add the instance to Control.Monad.Instances, undeprecating the module.
> _______________________________________________
> Libraries mailing list
> Libraries at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Libraries mailing list