[GHC] #1476: Template Haskell: splicing types and patterns

GHC trac at galois.com
Wed Feb 6 03:17:15 EST 2008


#1476: Template Haskell: splicing types and patterns
------------------------------+---------------------------------------------
 Reporter:  igloo             |          Owner:             
     Type:  bug               |         Status:  new        
 Priority:  normal            |      Milestone:  6.10 branch
Component:  Template Haskell  |        Version:  6.6.1      
 Severity:  normal            |     Resolution:             
 Keywords:                    |     Difficulty:  Unknown    
 Testcase:                    |   Architecture:  Unknown    
       Os:  Unknown           |  
------------------------------+---------------------------------------------
Comment (by simonpj):

 No, there's another major difference: a QQ splice is the result of
 applying a constant function (the parser) to a string.  The QQ splice is
 run in the renamer, before type checking even begins, while scopes are
 being resolved.

 In contrast TH splices run an arbitrary Haskell expression, which must be
 typechecked first.  This is therefore done during type checking.  It's
 much harder to deal with patterns.  See the discussion of TH splices that
 bind variables in http://research.microsoft.com/~simonpj/tmp/notes2.ps.

 So they are similar, yes, which is why the documentation appears in the TH
 section of the manual, but QQ splices have a very particular form (as you
 describe above).

 Bottom line: I don't yet see a good design for full TH splices in
 patterns.

 Simon

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1476#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the Glasgow-haskell-bugs mailing list