gore-and-ash-actor 1.1.1.0 → 1.2.1.0
raw patch · 2 files changed
+16/−4 lines, 2 filesdep +resourcetdep +transformersdep +transformers-base
Dependencies added: resourcet, transformers, transformers-base
Files
gore-and-ash-actor.cabal view
@@ -1,5 +1,5 @@ name: gore-and-ash-actor-version: 1.1.1.0+version: 1.2.1.0 synopsis: Gore&Ash engine extension that implements actor style of programming description: Please see README.md homepage: https://github.com/Teaspot-Studio/gore-and-ash-actor@@ -33,8 +33,11 @@ , gore-and-ash >= 1.1.0.0 , hashable >= 1.2.3.3 , mtl >= 2.2- , unordered-containers >= 0.2.5.1- + , resourcet >= 1.1.7.1+ , transformers >= 0.4.2+ , transformers-base >= 0.4.4+ , unordered-containers >= 0.2.5.1 + default-extensions: Arrows BangPatterns
src/Game/GoreAndAsh/Actor/Module.hs view
@@ -15,9 +15,12 @@ ActorT(..) ) where +import Control.Monad.Base import Control.Monad.Catch import Control.Monad.Fix +import Control.Monad.Error.Class import Control.Monad.State.Strict+import Control.Monad.Trans.Resource import Data.Proxy import Game.GoreAndAsh@@ -43,8 +46,14 @@ -- The module is pure within first phase (see 'ModuleStack' docs) but requires 'MonadThrow' -- instance of end monad, therefore currently only 'IO' end monad can handler the module. newtype ActorT s m a = ActorT { runActorT :: StateT (ActorState s) m a }- deriving (Functor, Applicative, Monad, MonadState (ActorState s), MonadFix, MonadTrans, MonadIO, MonadThrow, MonadCatch, MonadMask)+ deriving (Functor, Applicative, Monad, MonadState (ActorState s), MonadFix, MonadTrans, MonadIO, MonadThrow, MonadCatch, MonadMask, MonadError e) +instance MonadBase IO m => MonadBase IO (ActorT s m) where + liftBase = ActorT . liftBase++instance MonadResource m => MonadResource (ActorT s m) where + liftResourceT = ActorT . liftResourceT+ instance GameModule m s => GameModule (ActorT s m) (ActorState s) where type ModuleState (ActorT s m) = ActorState s runModule (ActorT m) s = do