{-# LANGUAGE OverloadedStrings #-} import qualified Data.ByteString as B import Blaze.ByteString.Builder (toByteStringIO) import Control.Applicative import Control.Monad.Trans.Either (runEitherT) import Heist import Heist.Compiled (renderTemplate) import Control.Lens heistConfig = (set hcNamespace "") $ -- (set hcInterpretedSplices defaultInterpretedSplices) $ (set hcLoadTimeSplices defaultLoadTimeSplices) $ (set hcTemplateLocations [loadTemplates "."]) $ emptyHeistConfig main = do heistState <- either (error "oops") id <$> (runEitherT $ initHeist heistConfig) builder <- maybe (error "oops") fst $ renderTemplate heistState "billy" toByteStringIO B.putStr builder