[Template-haskell] Internal type consistency of quoted expressions
Simon Peyton-Jones
simonpj at microsoft.com
Tue Aug 1 12:52:29 EDT 2006
Some quick replies
| [2] I am sane, right? I mean, is there any other reason for the
| internal type-consistency check other than to detect /potential/
| errors /earlier/?
Quite correct. But detecting errors earlier, perhaps much, much
earlier, is a Good Thing, right?
| I actually proposed something similar way back:
|
http://www.haskell.org//pipermail/template-haskell/2003-April/000048.htm
l
| for specifying rewrite rules which weren't all type correct in
| themselves, but the total effect of fully applying them all was type
| safe. I didn't push it much as it wasn't that important to me and
no-one
| else seemed interested (plus it felt a bit hackish).
Your proposal seems entirely reasonable to me. By not typechecking the
quotation at all, it pushes towards the extreme of more flexibility but
later error reporting. (MetaML is at the other extreme.) And if that
is what you want, it seems like a reasonable thing to me.
If you want to commit a patch that does it, go ahead. Please document
the change in the manual; and perhaps add a section on the TH wiki page
to explain what it's good for.
I don't hear a lot about TH these days, but occasionally I hear people
saying "I used TH to do X or Y". So I think that is good news; it works
well enough to be useful. But I'm sure it could be better in many ways.
Simon
More information about the template-haskell
mailing list