Skip to content

Commit 7fd81b5

Browse files
committed
Update compiled splice tutorial
1 parent ef5f313 commit 7fd81b5

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

snaplets/heist/templates/docs/tutorials/CompiledSplices.lhs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ buildbot. So first we need to get some boilerplate and imports out of the way.
2828
> import Heist.Tutorial.Imports
2929

3030
> import Control.Applicative
31+
> import Control.Lens
32+
> import Data.Map.Syntax
3133
> import qualified Data.Text as T
3234
> import Data.Text.Encoding
3335
> import qualified Heist.Compiled.LowLevel as C
@@ -113,9 +115,12 @@ directory with compiled splices.
113115
> -> IO (HeistState n)
114116
> load baseDir splices = do
115117
> tmap <- runEitherT $ do
116-
> let hc = HeistConfig mempty defaultLoadTimeSplices splices mempty
117-
> [loadTemplates baseDir]
118-
> initHeist hc
118+
> let sc = mempty & scLoadTimeSplices .~ defaultLoadTimeSplices
119+
> & scCompiledSplices .~ splices
120+
> & scTemplateLocations .~ [loadTemplates baseDir]
121+
> initHeist $ emptyHeistConfig & hcNamespace .~ ""
122+
> & hcErrorNotBound .~ False
123+
> & hcSpliceConfig .~ sc
119124
> either (error . concat) return tmap
120125

121126
Here's a function demonstrating all of this in action.

0 commit comments

Comments
 (0)