我正在尝试了解如何使用 Heist,但我发现的所有示例似乎都不起作用,而且我似乎找不到与我有相同问题的其他人。我在这里找到了一些示例代码:
但是,当我尝试运行第一个示例时,出现以下错误:
Main.hs:20:15:
‘hcCompiledSplices’ is not a record selector
In the expression:
mempty
{hcCompiledSplices = "foo" ## splice,
hcTemplateLocations = [loadTemplates "."]}
In an equation for ‘heistConfig’:
heistConfig
= mempty
{hcCompiledSplices = "foo" ## splice,
hcTemplateLocations = [loadTemplates "."]}
In the expression:
do { let heistConfig = ...;
heistState <- either (error "oops") id
<$> (runEitherT $ initHeist heistConfig);
builder <- maybe (error "oops") fst
$ renderTemplate heistState "simple";
toByteStringIO B.putStr builder }
Main.hs:22:15:
‘hcTemplateLocations’ is not a record selector
In the expression:
mempty
{hcCompiledSplices = "foo" ## splice,
hcTemplateLocations = [loadTemplates "."]}
In an equation for ‘heistConfig’:
heistConfig
= mempty
{hcCompiledSplices = "foo" ## splice,
hcTemplateLocations = [loadTemplates "."]}
In the expression:
do { let heistConfig = ...;
heistState <- either (error "oops") id
<$> (runEitherT $ initHeist heistConfig);
builder <- maybe (error "oops") fst
$ renderTemplate heistState "simple";
toByteStringIO B.putStr builder }
我究竟做错了什么?