From: simonpj Date: Tue, 13 May 2003 11:42:47 +0000 (+0000) Subject: [project @ 2003-05-13 11:42:47 by simonpj] X-Git-Tag: nhc98-1-18-release~652 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=2069ba2fe676247f67155a39507d3c23a352ffb1;p=ghc-base.git [project @ 2003-05-13 11:42:47 by simonpj] Generalise the type of listens slightly; a suggestion from Tom Pledger --- diff --git a/Control/Monad/Writer.hs b/Control/Monad/Writer.hs index 79ec97e..b941e65 100644 --- a/Control/Monad/Writer.hs +++ b/Control/Monad/Writer.hs @@ -59,7 +59,7 @@ class (Monoid w, Monad m) => MonadWriter w m | m -> w where listen :: m a -> m (a, w) pass :: m (a, w -> w) -> m a -listens :: (MonadWriter w m) => (w -> w) -> m a -> m (a, w) +listens :: (MonadWriter w m) => (w -> b) -> m a -> m (a, b) listens f m = do (a, w) <- listen m return (a, f w)