[Template-haskell] query functions

Abraham Egnor abe.egnor at gmail.com
Mon Jul 12 13:58:07 EDT 2004


One bit of functionality I've recently found a need for is various
query functions in TH, i.e. something like

typeMatches :: Type -> Type -> Bool

that tests if the second type is a valid specialization of the first
one.  The main need I've had for this is to test typeclass membership,
but it would also be useful so that TH code can maintain a mapping of
user-specified types to actions or suchlike.

Any chance of something like this getting into a future TH revision?

Abe


More information about the template-haskell mailing list