[Template-haskell] Pattern reification in Template Haskell

Sean Seefried sseefried at cse.unsw.edu.au
Tue Oct 19 21:02:04 EDT 2004


Hi all,

Just a quick question about pattern reification.

In Tim Sheard and Simon Peyton Jones' notes on Template Haskell paper 
we are told that the following declaration would be valid:

p1 = [p| (x,y) |]

And that this is literally equivalent to:

return (Ptuple [Pvar (mkBndr "x"), Pvar (mkBndr "y")])

But when I try it I get told that x and y are not in scope.  But isn't 
that precisely the point? I'm introducing new scope.
I realise there is still some development to be done on Template 
Haskell and I was wondering whether this was just one of the things 
still on the todo list or whether I was doing something wrong.

Cheers,

Sean



More information about the template-haskell mailing list