[Template-haskell] Reification of local variables

WANG Meng wangmeng at comp.nus.edu.sg
Fri Apr 1 13:19:17 EST 2005


Hi,

I am trying to write a function which does reification on its parameters.
What I understand is that the reify below will get the type information of
n available at the definition of fn.

> fn n = $(do info <- (reify 'n))

But how about I define fn as

> fn n = do info <- (reify 'n)

then I splice $(fn x) somewhere else? Will the reify gets type information
of x? Or something else?

In the second case, GHC keep on complaining

"`n' is not in the type environment at a reify"

What is the reason for this?





 -W-M-
  @ @
   |
  \_/


More information about the template-haskell mailing list