packages feed

monad-logger 0.3.28 → 0.3.28.1

raw patch · 3 files changed

+13/−8 lines, 3 filesdep ~base

Dependency ranges changed: base

Files

ChangeLog.md view
@@ -1,3 +1,7 @@+## 0.3.28.1++* Fix support for GHC 7.8 [#154](https://github.com/kazu-yamamoto/logger/pull/154)+ ## 0.3.28  * Added `WriterLoggingT` for collecting log lines and help with testing
Control/Monad/Logger.hs view
@@ -102,9 +102,10 @@ import Language.Haskell.TH.Syntax (Lift (lift), Q, Exp, Loc (..), qLocation) #endif +import Data.Functor ((<$>)) import Data.Monoid (Monoid) -import Control.Applicative (Applicative (..))+import Control.Applicative (Applicative (..), WrappedMonad(..)) import Control.Concurrent.Chan (Chan(),writeChan,readChan) import Control.Concurrent.STM import Control.Concurrent.STM.TBChan@@ -464,11 +465,11 @@ execWriterLoggingT ma = snd <$> runWriterLoggingT ma  instance Monad m => Monad (WriterLoggingT m) where-  return = pure+  return = unwrapMonad . pure   (WriterLoggingT ma) >>= f = WriterLoggingT $ do     (a, msgs)   <- ma     (a', msgs') <- unWriterLoggingT $ f a-    pure (a', appendDList msgs msgs')+    return (a', appendDList msgs msgs')  instance Applicative m => Applicative (WriterLoggingT m) where   pure a = WriterLoggingT . pure $ (a, emptyDList)@@ -480,21 +481,21 @@     fmap (\(a, msgs) -> (f a, msgs)) ma  instance Monad m => MonadLogger (WriterLoggingT m) where-  monadLoggerLog loc source level msg = WriterLoggingT . pure $ ((), singleton (loc, source, level, toLogStr msg))+  monadLoggerLog loc source level msg = WriterLoggingT . return $ ((), singleton (loc, source, level, toLogStr msg))   instance Trans.MonadTrans WriterLoggingT where-  lift ma = WriterLoggingT $ (, emptyDList) <$> ma+  lift ma = WriterLoggingT $ (, emptyDList) `liftM` ma  instance MonadIO m => MonadIO (WriterLoggingT m) where-  liftIO ioa = WriterLoggingT $ (, emptyDList) <$> liftIO ioa+  liftIO ioa = WriterLoggingT $ (, emptyDList) `liftM` liftIO ioa  instance MonadBase b m => MonadBase b (WriterLoggingT m) where   liftBase = liftBaseDefault  instance MonadTransControl WriterLoggingT where   type StT WriterLoggingT a = (a, DList LogLine)-  liftWith f = WriterLoggingT $ fmap (\x -> (x, emptyDList))+  liftWith f = WriterLoggingT $ liftM (\x -> (x, emptyDList))                                       (f $ unWriterLoggingT)   restoreT = WriterLoggingT 
monad-logger.cabal view
@@ -1,5 +1,5 @@ name:                monad-logger-version:             0.3.28+version:             0.3.28.1 synopsis:            A class of monads which can log messages. description:         Hackage documentation generation is not reliable. For up to date documentation, please see: <http://www.stackage.org/package/monad-logger>. homepage:            https://github.com/kazu-yamamoto/logger