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 }
私は何を間違っていますか?