Created
June 30, 2017 16:33
-
-
Save bitemyapp/f3e8d303fd6cdd9af516d685abc982d9 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
module Transformer where | |
import Control.Monad.Reader | |
import Control.Monad.Trans | |
data Config = Config { filename :: String } deriving (Show) | |
c = Config { filename = "a.txt" } | |
loadFile :: ReaderT Config IO String | |
loadFile = do | |
-- This is how I assume I get the filename from the config | |
fname <- ask filename | |
-- How am I supposed to provide the fname to loadFile so that I can end up with a ReaderT Config IO String? | |
return loadFile fname |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment