[Template-haskell] reify: how to show the result.

Rene de Visser rene_de_visser at hotmail.com
Tue Jul 19 13:08:05 EDT 2005


I guess this is easy, but I am not managing it.

I have

data SmallDB = SmallDB { rel1 :: Set.Set String
                       , rel2 :: Set.Set Integer } deriving Show

and wish to see the results of reify 'SmallDB

which I need to evaluate this at compile time.

test212 data_con = do; (DataConI _ typ _ _) <- runQ (reify data_con); print 
typ
test214 data_con = do; string <- runIO $ test212 data_con; return string

Which I now need to splice in

test213 = $(test214 'SmallDB)

so that I can run test213 to see the result.

How do I write test214 so that it has the correct result type?

What does report do? Can I use it to print out the result?

Why does the Info type not support the type class show?

Rene.




More information about the template-haskell mailing list