Skip to content

Commit

Permalink
Generalize MonadAccum w (AccumT w m).
Browse files Browse the repository at this point in the history
There is no reason to restrict this instance any further.
  • Loading branch information
jumper149 committed Jan 14, 2023
1 parent 37cbd92 commit 7172d34
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions Control/Monad/Accum.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7172d34

Please sign in to comment.