When I try loading my Heist (0.11) templates with this function:
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
I get this error:
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 }'
To me, loadTemplate
seems to be returning the expected type, except with the type parameters filled in with concrete types. What am I missing?