Re: [Template-haskell] reifyDecl: syntax and semantics
Reification is difficult for lots of reasons. But here is a trick that you might be able to use.
Break your program into pieces, where you split the use of decls you want to reify into two parts.
-------------------- d1 = [d| data T = ... |]
splice d1
---------------------
Then you have a meta-variable "d1" with the reified form, and the real data declaration because of the splice.
Tim Sheard
I definitely prefer your solution which just avoids reification, for one simple reason: it works ! Question is: is there any case where reification is indispensable or is this trick general ? (and then why bother with reification ?) However, I'm still not very happy with this solution, because (again) thinking of a library working on the reified declarations, then the part above has to be written by the "user". Thanks. -fr-
participants (1)
-
François-Régis Sinot