Proposal: Overloaded Quotes for Template Haskell
Simon Peyton-Jones
simonpj at microsoft.com
Sat Dec 31 16:55:37 CET 2011
| > And indeed there is such a function: it's called runQ.
| >
| > So I think what you want is already available.
|
| If there are no splices in the quote then, yes, that is sufficient.
| However, as there is no function of type "forall m. Quasi m => m Exp
| -> Q Exp", the contents of all splices must be of type "Q Exp". Thus
| in the expression "[| ... $( foo ) ... |]" there is no way for foo to
| modify the state of the memoization table.
I'm sorry, I don't understand what you say here.
You started your post by saying that you want quote to be of type
forall m. Quasi m => m Exp
But they already are! (With a newtype wrapper.)
Simon
More information about the Libraries
mailing list