[Haskell-cafe] Using Template Haskell to automate QuickCheck testing?

Bulat Ziganshin bulat.ziganshin at gmail.com
Wed Jun 20 23:50:56 EDT 2007


Hello Brent,

Thursday, June 21, 2007, 5:38:02 AM, you wrote:

> However, after reading all about TH it doesn't seem like there's a way
> to do this (reflecting on the current module to pull out the names of 
> certain top-level declarations).  

i don't know whether it's implemented, but standard workaround is to
put entire module body (or at least prop_*) in quotation brackets and explore
returned result, like this:

$(optimize [d| fib = .... |])

just for case you don't know about this - i've written TH tutorial and doc:

http://www.haskell.org/bz/th3.htm
http://www.haskell.org/bz/thdoc.htm


-- 
Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com



More information about the Haskell-Cafe mailing list