From 429c24f09ae584353405113073f05fe5b129678a Mon Sep 17 00:00:00 2001 From: Kjetil Orbekk Date: Wed, 17 Feb 2016 07:15:40 +0100 Subject: Add MonadIO to App. --- src/Lib.hs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Lib.hs b/src/Lib.hs index 9748aed..695f0de 100644 --- a/src/Lib.hs +++ b/src/Lib.hs @@ -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 -- cgit v1.2.3