Monad instance for Monoid e => (,) e

Mario Blažević mblazevic at stilo.com
Fri Jul 26 23:30:41 CEST 2013


On 13-07-25 01:14 PM, Edward Kmett wrote:
> +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.
>

I'm late to the party, but +1.





More information about the Libraries mailing list