当我尝试使用此功能加载我的 Heist (0.11) 模板时:
load :: MonadIO n => FilePath -> [(Text, Splice n)] -> IO (HeistState n)
load baseDir splices = do
tmap <- runEitherT $ do
templates <- loadTemplates baseDir
let hc = HeistConfig [] defaultLoadTimeSplices splices [] templates
initHeist hc
either (error . concat) return tmap
我收到此错误:
Couldn't match expected type `EitherT e0 m0 t0'
with actual type `either-3.1:Control.Monad.Trans.Either.EitherT
[String] IO Heist.TemplateRepo'
In the return type of a call of `loadTemplates'
In a stmt of a 'do' block: templates <- loadTemplates baseDir
In the second argument of `($)', namely
`do { templates <- loadTemplates baseDir;
let hc
= HeistConfig [] defaultLoadTimeSplices splices [] templates;
initHeist hc }'
对我来说,loadTemplate
似乎返回了预期的类型,除了用具体类型填充的类型参数。我错过了什么?