haskell / mtl

The Monad Transformer Library
http://www.haskell.org/haskellwiki/Monad_Transformers
Other
364 stars 65 forks source link

More general MonadAccum instance missing #152

Open turion opened 4 months ago

turion commented 4 months ago

There is an instance Monoid w => MonadAccum w (AccumT w Identity):

https://github.com/haskell/mtl/blob/6be8cb55ca9a8bfa6111e3004e4b56b91ed5edcc/Control/Monad/Accum.hs#L163

But a more general instance that should exist would be:

instance (Monoid w, Monad m) => MonadAccum w (AccumT w m)`
turion commented 4 months ago

Happy to send a PR if you want :)