[Haskell-cafe] lift in TemplateHaskell?

Lyle Kopnicky lists at qseep.net
Tue Apr 14 17:51:15 EDT 2009

Hi folks,

I'm having trouble reading the TemplateHaskell docs and trying to do
something that seems like it should be simple. In MetaML, there is a 'lift'
function which does exactly what I want to do. Here's an example function:

let double n = [| 2 * $( litE (integerL n) ) |]

This works as intended, but instead of writing "litE (integerL n)" I just
want to write "lift n", or something similar. I expect that would involve a
type class called something like Liftable that would lift literals using the
appropriate functions. Does this exist?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20090414/6f346809/attachment.htm

More information about the Haskell-Cafe mailing list