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

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 (MonadTrans TemplateMonad)
arising from the use of 'lift'

Gregory Collins advised replacing mtl with monads-fd and transformers.

However, this breaks my custom monad (eg. MonadIO is no longer automatically 
derived).

How do I get this to work?

Kevin


      
_______________________________________________
Snap mailing list
[email protected]
http://mailman-mail5.webfaction.com/listinfo/snap

Reply via email to