Re: Template Haskell pattern quotations

2010-02-04 Thread Brad Larsen
On Thu, Feb 4, 2010 at 5:47 AM, Sebastian Fischer wrote: > > On Feb 4, 2010, at 8:58 AM, Simon Peyton-Jones wrote: > >> Unless I have a sudden revelation I don't expect to implement pattern >> splices anytime soon. >> >> On the other hand, pattern *quasiquotes* are fine; they are run by the >> ren

RE: Template Haskell pattern quotations

2010-02-04 Thread Simon Peyton-Jones
| If I understand Brad correctly, then what he needs is what he called | pattern quotation rather than splicing. ... | | Is there a problem with adding support for pattern brackets on the | right-hand side of function definitions in order to simplify the | definition of quasi quoters? Oh, thank y

Re: Template Haskell pattern quotations

2010-02-04 Thread Sebastian Fischer
On Feb 4, 2010, at 8:58 AM, Simon Peyton-Jones wrote: Unless I have a sudden revelation I don't expect to implement pattern splices anytime soon. On the other hand, pattern *quasiquotes* are fine; they are run by the renamer before scope analysis is done. So you can certainly say

RE: Template Haskell pattern quotations

2010-02-03 Thread Simon Peyton-Jones
| My question: Are Template Haskell pattern quotations (i.e., [p| ... | |]) not implemented in GHC because they are rather tricky to | implement, or because there has not been demand for them? They are tricky! The trouble is that patterns *bind variables*. I don't know how to deal cleanly with

Re: Template Haskell pattern quotations

2010-02-03 Thread Robert Greayer
The *splicing* of patterns is considered tricky, see: http://hackage.haskell.org/trac/ghc/ticket/1476 Implementing pattern quotations might be less tricky, but I would imagine to make them useful, you'd have to allow splicing things *into* them, which requires implementing pattern splicing. That