[GHC] #5618: TH cannot splice patterns in declaration quotes

GHC cvs-ghc at haskell.org
Wed Nov 9 11:13:33 CET 2011


#5618: TH cannot splice patterns in declaration quotes
---------------------------------+------------------------------------------
    Reporter:  Lennart           |       Owner:                  
        Type:  bug               |      Status:  new             
    Priority:  normal            |   Component:  Template Haskell
     Version:  7.2.1             |    Keywords:                  
    Testcase:                    |   Blockedby:                  
          Os:  Unknown/Multiple  |    Blocking:                  
Architecture:  Unknown/Multiple  |     Failure:  None/Unknown    
---------------------------------+------------------------------------------
 Try this:
 {{{
 {-# LANGUAGE TemplateHaskell #-}
 module TH2 where
 import Language.Haskell.TH

 foo :: PatQ -> DecsQ
 foo p = [d| $(p) = 1 |]
 }}}

 Or this
 {{{
 {-# LANGUAGE TemplateHaskell #-}
 module TH3 where
 import Language.Haskell.TH

 foo :: PatQ -> DecsQ
 foo p = [d| f $(p) = 1 |]
 }}}

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



More information about the Glasgow-haskell-bugs mailing list