
14 Apr
2009
14 Apr
'09
5:51 p.m.
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? Thanks, Lyle