Monoid instance for IO

Andrew Gibiansky andrew.gibiansky at gmail.com
Thu Nov 13 17:10:39 UTC 2014


Very +1

Just yesterday I was hoping to have a (Monad m, Monoid w) => Monoid (m w)
instance; that's probably not possible because it conflicts with too many
things, such as the Monoid w => Monoid (Maybe w) instance, but having
Monoid w => Monoid (IO w) would have solved my problem. Specifically, this
was really useful for me with Foldable, because it allows foldMap to work
in a monad; I've had to define my own `foldMapM` several times already.

-- Andrew

On Thu, Nov 13, 2014 at 7:32 AM, Alexander Berntsen <alexander at plaimi.net>
wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> I've been waiting for this for a while.
>
> +1. At least until someone presents downsides that I've been overlooking.
>
> - --
> Alexander
> alexander at plaimi.net
> https://secure.plaimi.net/~alexander
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iF4EAREIAAYFAlRkzvoACgkQRtClrXBQc7VDVgEAlswOK3dOOaooYtbh48yoWokh
> qDHdjy6ryYDvUMmCp/0A/0d5xHR9cUFQ9jcWLE9KXDKZ6oJvOxVDGMz2yMcAp+uo
> =zP7M
> -----END PGP SIGNATURE-----
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://www.haskell.org/mailman/listinfo/libraries
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20141113/6a402940/attachment.html>


More information about the Libraries mailing list