diff options
-rw-r--r-- | src/Lib.hs | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -5,6 +5,7 @@ module Lib where import Control.Lens (makeLenses) import Control.Monad.Identity (Identity(..)) +import Control.Monad.IO.Class (MonadIO(..)) import Control.Monad.Reader (ReaderT(..), runReaderT) import Control.Monad.Reader.Class (MonadReader(..)) import Control.Monad.State.Class (MonadState(..)) @@ -35,14 +36,15 @@ instance Default World where makeLenses ''World newtype App a = App { - runApp :: StateT World (ReaderT Config Identity) a} + runApp :: StateT World (ReaderT Config IO) a} deriving ( Applicative , Functor , Monad , MonadState World , MonadReader Config + , MonadIO ) -evalApp :: App a -> World -> Config -> a +evalApp :: App a -> World -> Config -> IO a evalApp f world config = - runIdentity (runReaderT (evalStateT (runApp f) world) config) + runReaderT (evalStateT (runApp f) world) config |