di-monad 1.3.1 → 1.3.2
raw patch · 3 files changed
+26/−5 lines, 3 filesdep +streamingdep +unliftio-corePVP ok
version bump matches the API change (PVP)
Dependencies added: streaming, unliftio-core
API changes (from Hackage documentation)
+ Di.Monad: instance (Di.Monad.MonadDi level path msg m, GHC.Base.Functor f) => Di.Monad.MonadDi level path msg (Streaming.Internal.Stream f m)
+ Di.Monad: instance Control.Monad.IO.Unlift.MonadUnliftIO m => Control.Monad.IO.Unlift.MonadUnliftIO (Di.Monad.DiT level path msg m)
Files
- CHANGELOG.md +8/−1
- di-monad.cabal +5/−3
- lib/Di/Monad.hs +13/−1
CHANGELOG.md view
@@ -1,6 +1,13 @@+# Version 1.3.2++* Add `MonadUnliftIO` instance for `DiT`.++* Add `MonadDi` instance for `streaming`'s `Stream`.++ # Version 1.3.1 -* Instance `MonadError e m => MonadError e (DiT level path msg m)`+* Add `MonadError` instance for `DiT`. # Version 1.3
di-monad.cabal view
@@ -1,5 +1,6 @@+cabal-version: 1.18 name: di-monad-version: 1.3.1+version: 1.3.2 author: Renzo Carbonara maintainer: renλren.zone copyright: Renzo Carbonara 2017-2018@@ -8,7 +9,6 @@ extra-source-files: README.md CHANGELOG.md category: Logging build-type: Simple-cabal-version: >=1.18 synopsis: mtl flavoured typeful hierarchical structured logging for di-core. description: mtl flavoured typeful hierarchical structured logging for di-core. homepage: https://github.com/k0001/di@@ -26,7 +26,9 @@ mtl, pipes, stm,- transformers+ transformers,+ unliftio-core,+ streaming ghcjs-options: -Wall -O3 ghc-options: -Wall -O2
lib/Di/Monad.hs view
@@ -8,8 +8,10 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE RankNTypes #-}+{-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_HADDOCK not-home #-}+{-# OPTIONS_GHC -Wno-unused-imports #-} -- | This module offers a monadic alternative to the “bare” logging API offered -- by "Di.Core".@@ -67,6 +69,7 @@ import Control.Monad.Fail (MonadFail) import Control.Monad.Fix (MonadFix) import Control.Monad.IO.Class (MonadIO, liftIO)+import Control.Monad.IO.Unlift (MonadUnliftIO) import Control.Monad (MonadPlus) import Control.Monad.Reader (ReaderT(ReaderT), MonadReader) import qualified Control.Monad.Reader as Reader@@ -86,6 +89,7 @@ import qualified Pipes as P import qualified Pipes.Internal as P import Prelude hiding (filter, error, log)+import qualified Streaming.Internal as S #if MIN_VERSION_transformers(0,5,3) import Control.Monad.Trans.Accum (AccumT(AccumT))@@ -111,7 +115,7 @@ = DiT (ReaderT (Di level path msg, H STM m) m a) deriving (Functor, Applicative, Alternative, Monad, MonadIO, MonadFail, MonadFix, MonadZip, MonadPlus, MonadCont,- MonadState s, MonadWriter w, MonadError e)+ MonadState s, MonadWriter w, MonadError e, MonadUnliftIO) -- | Build a 'DiT'. --@@ -499,6 +503,14 @@ instance MonadDi level path msg m => MonadDi level path msg (P.ListT m) where {-# INLINE local #-} local f = \(P.Select p) -> P.Select (local f p)++instance (MonadDi level path msg m, Functor f)+ => MonadDi level path msg (S.Stream f m) where+ {-# INLINABLE local #-}+ local g = \case+ S.Step fs -> S.Step (local g <$> fs)+ S.Effect ms -> S.Effect (local g <$> ms)+ S.Return r -> S.Return r --------------------------------------------------------------------------------