[GHC] #12164: Type signatures in patterns not (yet) handled by Template Haskell

GHC ghc-devs at haskell.org
Tue Jun 7 21:23:23 UTC 2016


#12164: Type signatures in patterns not (yet) handled by Template Haskell
-------------------------------------+-------------------------------------
           Reporter:  ezyang         |             Owner:
               Type:  feature        |            Status:  new
  request                            |
           Priority:  normal         |         Milestone:
          Component:  Template       |           Version:  8.0.1
  Haskell                            |
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 This bit me just now, so I figured I should report a feature request bug.

 {{{
 ezyang at sabre:~/Dev/whisk$ ghc-8.0 --interactive -XTemplateHaskell
 GHCi, version 8.0.0.20160204: http://www.haskell.org/ghc/  :? for help
 Prelude> Language.Haskell.TH.runQ [| \(x :: ()) -> x |]

 <interactive>:1:29: error:
     Type signatures in patterns not (yet) handled by Template Haskell
       x :: ()
 }}}

 In the code, there is a bit of mumbling about scoped type variables. I
 believe it is referring to code like this:

 {{{
 Prelude> :t (\(x :: a) -> (x :: a))
 (\(x :: a) -> (x :: a)) :: a -> a
 }}}

 Described in the manual here:
 https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/glasgow_exts.html
 #pattern-type-signatures
 This means that TH has to somehow bring the type into scope. I don't
 actually know how to do it.

 It seems a bit awful for this to be the reason why these quotes are not
 accepted; maybe without scoped type variables we should be able to do
 something cheap and cheerful.

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


More information about the ghc-tickets mailing list