Opened 5 years ago

Closed 5 years ago

#5618 closed bug (invalid)

TH cannot splice patterns in declaration quotes

Reported by: Lennart Owned by:
Priority: normal Milestone:
Component: Template Haskell Version: 7.2.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


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 |]

Change History (1)

comment:1 Changed 5 years ago by simonpj

  • Resolution set to invalid
  • Status changed from new to closed

Well to be fair the manual says explicitly "Note that pattern splices are not supported. " (

But see my proposal for Template Haskell, which would support pattern splices. I totally lack cycles to act upon it.


Note: See TracTickets for help on using tickets.