[Haskell-cafe] Heist template splice functions and custom monad

Kevin Jardine kevinjardine at yahoo.com
Mon Jun 14 16:15:29 EDT 2010

I'd like to run Heist template splice functions in my own custom monad.

I can define a splice function as:

mySplice :: Splice MyMonad

However, when I try to call functions that return values in my monad in mySplice, I get a compile error:

Couldn't match expected type TemplateMonad MyMonad a 
against inferred type MyMonad ()

I've seen an example in the Heist documentation where the inner MyMonad is accessed using lift. But when I try that, I get another compile error:

No instance for (Monad Trans TemplateMonad)
arising from the use of 'lift'

What do I do to get this to work?



More information about the Haskell-Cafe mailing list