[Template-haskell] Pattern reification in Template Haskell

Simon Peyton-Jones simonpj at microsoft.com
Wed Oct 20 03:45:48 EDT 2004


Yes, I'm afraid that pattern quotations and splices are very much not
implemented.  There's a whole raft of design questions which we sort-of
answer in that design note, but not terribly satisfactorily.

I do have a bunch of things on my TH to-do list.  Pattern splices aren't
at the top of it, in fact, but name-splicing -- the ability to splice a
name in a binding position -- would be very useful.   But there was so
little reaction to my last few messages to this list that TH has slipped
down my priority list.  (Currently I'm busy with GADTs.)  I'm not sure
whether the quietness of the TH list is because (a) TH works so well
that there's no need to say anything or (b) no one is using it.  

Simon

| -----Original Message-----
| From: template-haskell-bounces at haskell.org
[mailto:template-haskell-bounces at haskell.org] On
| Behalf Of Sean Seefried
| Sent: 20 October 2004 02:02
| To: Template Haskell Mailing List
| Subject: [Template-haskell] Pattern reification in Template Haskell
| 
| 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
| 
| _______________________________________________
| template-haskell mailing list
| template-haskell at haskell.org
| http://www.haskell.org/mailman/listinfo/template-haskell


More information about the template-haskell mailing list