From 7172d346b5f218fcc2f8e6609718ad1d4235b9a7 Mon Sep 17 00:00:00 2001 From: Felix Springer Date: Fri, 13 Jan 2023 12:53:09 +0100 Subject: [PATCH] Generalize `MonadAccum w (AccumT w m)`. There is no reason to restrict this instance any further. --- Control/Monad/Accum.hs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Control/Monad/Accum.hs b/Control/Monad/Accum.hs index 7be9140..88acde6 100644 --- a/Control/Monad/Accum.hs +++ b/Control/Monad/Accum.hs @@ -109,7 +109,6 @@ import qualified Control.Monad.Trans.Writer.CPS as CPSWriter import qualified Control.Monad.Trans.Writer.Lazy as LazyWriter import qualified Control.Monad.Trans.Writer.Strict as StrictWriter import Data.Functor (($>)) -import Data.Functor.Identity (Identity) import Data.Kind (Type) -- | The capability to accumulate. This can be seen in one of two ways: @@ -160,7 +159,7 @@ class (Monoid w, Monad m) => MonadAccum w m | m -> w where {-# MINIMAL accum | look, add #-} -- | @since 2.3 -instance (Monoid w) => MonadAccum w (AccumT w Identity) where +instance (Monoid w, Monad m) => MonadAccum w (AccumT w m) where look = Accum.look add = Accum.add accum = Accum.accum