Reification of local variables

WANG Meng <[email protected]> Sat, 2 Apr 2005 02:19:17 +0800 (GMT-8)
Newsgroups gmane.comp.lang.haskell.template
Message-ID <[email protected]>
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-
  @ @
   |
  \_/