summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKjetil Orbekk <kjetil.orbekk@gmail.com>2016-02-17 07:15:40 +0100
committerKjetil Orbekk <kjetil.orbekk@gmail.com>2016-02-17 07:15:40 +0100
commit429c24f09ae584353405113073f05fe5b129678a (patch)
tree5b9805ed604c2eec12ebdc4e440b58c811acf6c4
parent938721877d1a4d8d0c304ef43572856b1a39970a (diff)
Add MonadIO to App.
-rw-r--r--src/Lib.hs8
1 files 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