-
-
Save dminuoso/0b9db8bcf0c92e8861640f46a6e1b735 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Control.Monad.IO.Class (liftIO) | |
type MyApplication = Request | |
-> (Response -> ReaderT Env IO ResponseReceived) | |
-> ReaderT Env IO ResponseReceived | |
mkApp :: Env -> MyApplication -> Application | |
mkApp env app req respond = flip runReaderT env $ | |
app req (\r -> ReaderT (\_ -> respond r)) | |
mkApp2 :: Env -> MyApplication -> Application | |
mkApp2 env app req respond = flip runReaderT env $ | |
app req (liftIO . respond) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment