Passing data directly into templates in compiled Heist (Haskell)?
问题 I use compiled Heist. My splices only do run-time work (no load-time work). I have a template.tpl like this: <html> <head> <title><titleSplice/></title> </head> <body> <bodySplice/> </body> </html> This is how I do things: Within the Snap action for a /:param route, I use renderTemplate heistState "template" to obtain a MyHeistRuntimeMonad Builder . I can pass the :param value to my splice by putting it into my runtime monad via ReaderT: type MyHeistRuntimeMonad = ReaderT String IO . (Where