Hello,
I am still playing with template-haskell...
I
wonder, is there any reason why a quasiquoter cannot create haskell
statements and declarations in addition to expressions and patterns? Or
more generally create any legal Haskell syntax tree.
I.e Suppose I would like to create a quasiquoter for the C language (please, imagine that it could be useful).
I could write sth such as :
[$c|
int a = 6;
int b = 7;
int c = a +b;
struct S { int x; int y}
|]
It could be nice to generate the appropriate haskell code:
a = 6
b= 7
c= a + b
data S = S { x::Int; y:Int}
etc
That
would allow to really embed any kind of language in a more or less easy
way into haskell, provided that code can be translated into legal
haskell.
Is there anything that prevent these features.
Thank you
Regards
J-C