[project @ 2004-02-05 11:58:21 by malcolm]
[ghc-base.git] / Control / Monad / Writer.hs
index 898069c..de66eb4 100644 (file)
@@ -3,22 +3,19 @@
 -- Module      :  Control.Monad.Writer
 -- Copyright   :  (c) Andy Gill 2001,
 --               (c) Oregon Graduate Institute of Science and Technology, 2001
--- License     :  BSD-style (see the file libraries/core/LICENSE)
+-- License     :  BSD-style (see the file libraries/base/LICENSE)
 -- 
 -- Maintainer  :  libraries@haskell.org
 -- Stability   :  experimental
--- Portability :  non-portable ( requires mulit-parameter type classes,
---                              requires functional dependencies )
---
--- $Id: Writer.hs,v 1.2 2002/04/24 16:31:38 simonmar Exp $
+-- Portability :  non-portable (multi-param classes, functional dependencies)
 --
 -- The MonadWriter class.
 --
 --       Inspired by the paper
---       \em{Functional Programming with Overloading and
---           Higher-Order Polymorphism},
---         \A[HREF="http://www.cse.ogi.edu/~mpj"]{Mark P Jones},
---               Advanced School of Functional Programming, 1995.}
+--       /Functional Programming with Overloading and
+--           Higher-Order Polymorphism/, 
+--         Mark P Jones (<http://www.cse.ogi.edu/~mpj/>)
+--               Advanced School of Functional Programming, 1995.
 -----------------------------------------------------------------------------
 
 module Control.Monad.Writer (
@@ -26,26 +23,24 @@ module Control.Monad.Writer (
        listens,
        censor,
        Writer(..),
-       runWriter,
        execWriter,
        mapWriter,
        WriterT(..),
-       runWriterT,
        execWriterT,
        mapWriterT,
        module Control.Monad,
-       module Control.Monad.Monoid,
        module Control.Monad.Fix,
        module Control.Monad.Trans,
+       module Data.Monoid,
   ) where
 
 import Prelude
 
 import Control.Monad
-import Control.Monad.Monoid
 import Control.Monad.Fix
 import Control.Monad.Trans
 import Control.Monad.Reader
+import Data.Monoid
 
 -- ---------------------------------------------------------------------------
 -- MonadWriter class
@@ -64,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)