In general, the way to find the definition of something with TH is using the reify
function. However:
You can't use
reify
at run-time viarunQ
. The information it needs is not available except during compilation.Currently, using
reify
to get function definitions is not implemented due to lack of interest anyway.
Looks like you'll need to find another route. Have you considered using the haskell-src-exts
package for parsing and/or the GHC API or something based on it?