[Haskell-cafe] code generation
Martin Hofmann
martin.hofmann at uni-bamberg.de
Tue Nov 4 07:41:01 EST 2008
Sorry for referring to a post, a bit ago.
> http://www-users.cs.york.ac.uk/~ndm/derive/ (Deriving Generic Functions
> by Example).
>
Thanks for the pointer, it was already on my to-read-pile :-)
> I think using Template Haskell for your work would fit very nicely, so
> is a good choice to learn :-)
>
I already got used to TH a bit, but I am not sure if it is appropriate
for my purpose, or at least not completely.
I want to load Haskell code into my program at runtime in an abstract
representation (as TH), modify it and then type-check it or coerce it
into a value (or execute it). For me it looks like I need a combination
of Hint and TH.
However, Hint can only interpret strings and to get a string from a QExp
I have to enter the IO Monad using runQ. So, wouldn't it deteriorate my
performance to do it all in the IO? Is there another way?
Thanks,
Martin
More information about the Haskell-Cafe
mailing list