如何使用 MonadReader 和 MonadIO 运行 这个方法?

How do I run this method with MonadReader and MonadIO?

我正在关注 this post 关于 Haskell 中的 reader monad。

以定义开头:

load :: Config -> String -> IO String
load config x -> readFile (config ++ x)

其中 Config 是 String 的类型别名,代表目录名。

该方法用于在屏幕上显示文件的内容,例如“./myFile.txt”。

我 运行 这个方法来自 ghci with:

load "./" "myFile.txt"

第二个例子介绍了reader monad:

load :: (MonadReader Config m, MonadIO m) => String -> m String
load x = do
    config <- ask
    liftIO $ readFile (config ++ x)

问题是:我如何从 ghci 运行 它?

我试过类似的东西:

(runReader load "myFile.txt") "./"

但没有快乐。

加载./myFile.txt的命令是什么?

runReaderT (load "myFile.txt") "./" :: IO String