gore-and-ash-logging 1.1.1.0 → 1.2.1.0
raw patch · 2 files changed
+15/−4 lines, 2 filesdep +resourcetdep +transformers-base
Dependencies added: resourcet, transformers-base
Files
gore-and-ash-logging.cabal view
@@ -1,5 +1,5 @@ name: gore-and-ash-logging-version: 1.1.1.0+version: 1.2.1.0 synopsis: Core module for gore-and-ash with logging utilities description: Please see README.md homepage: https://github.com/Teaspot-Studio/gore-and-ash-logging@@ -26,10 +26,12 @@ , exceptions >= 0.8.0.2 , gore-and-ash >= 1.1.0.0 , mtl >= 2.2+ , resourcet >= 1.1.7.1 , text >= 1.2.1 , text-show >= 2 , transformers >= 0.4.2- + , transformers-base >= 0.4.4+ default-extensions: DataKinds DeriveGeneric
src/Game/GoreAndAsh/Logging/Module.hs view
@@ -15,12 +15,15 @@ LoggingT(..) ) where +import Control.Monad.Base import Control.Monad.Catch+import Control.Monad.Error.Class import Control.Monad.Fix import Control.Monad.State.Strict+import Control.Monad.Trans.Resource+import Data.Proxy import qualified Data.Sequence as S import qualified Data.Text.IO as T-import Data.Proxy import Game.GoreAndAsh import Game.GoreAndAsh.Logging.State@@ -45,8 +48,14 @@ -- The module is pure within first phase (see 'ModuleStack' docs) and could be used -- with 'Identity' end monad. newtype LoggingT s m a = LoggingT { runLoggingT :: StateT (LoggingState s) m a }- deriving (Functor, Applicative, Monad, MonadState (LoggingState s), MonadFix, MonadTrans, MonadIO, MonadThrow, MonadCatch, MonadMask)+ deriving (Functor, Applicative, Monad, MonadState (LoggingState s), MonadFix, MonadTrans, MonadIO, MonadThrow, MonadCatch, MonadMask, MonadError e) +instance MonadBase IO m => MonadBase IO (LoggingT s m) where+ liftBase = LoggingT . liftBase++instance MonadResource m => MonadResource (LoggingT s m) where + liftResourceT = LoggingT . liftResourceT + instance GameModule m s => GameModule (LoggingT s m) (LoggingState s) where type ModuleState (LoggingT s m) = LoggingState s runModule (LoggingT m) s = do