
10 Nov
2006
10 Nov
'06
2:27 p.m.
On 11/10/06, szefirov@ot.ru
Why doesn't reify return function body?
reify (mkName "somefunction") for a function defined in the same module returns constructor VarI (of data type Info) that does not contain function declaration in (Maybe Dec) part.
What actions should I perform to get a function body with patterns, expressions and all that?
I'm not sure, but when faced a similar problem I used the Haskell98 parser to get at the AST of the functions. In my case the functions were defined in a different module so TH definitely couldn't get at the internals. The details of what I did are here: http://blog.codersbase.com/2006/09/01/simple-unit-testing-in-haskell/ HTH, Jason