diff options
author | Kjetil Orbekk <kjetil.orbekk@gmail.com> | 2016-02-17 07:15:40 +0100 |
---|---|---|
committer | Kjetil Orbekk <kjetil.orbekk@gmail.com> | 2016-02-17 07:15:40 +0100 |
commit | 429c24f09ae584353405113073f05fe5b129678a (patch) | |
tree | 5b9805ed604c2eec12ebdc4e440b58c811acf6c4 | |
parent | 938721877d1a4d8d0c304ef43572856b1a39970a (diff) |
Add MonadIO to App.
-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 |