Kevin Jardine <kevinjard...@yahoo.com> writes:

> 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?

You should post this to the Snap framework mailing list -- join here:
http://mailman-mail5.webfaction.com/listinfo/snap. Please follow up
there.

TemplateMonad does have a MonadTrans instance:

   
http://hackage.haskell.org/packages/archive/heist/0.2.0/doc/html/Text-Templating-Heist.html#t%3ATemplateMonad

Make sure you're using the "transformers"/"monads-fd" libraries and not
"mtl".

G
-- 
Gregory Collins <g...@gregorycollins.net>
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to