Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 5,240
    • Issues 5,240
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 566
    • Merge requests 566
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #12164
Closed
Open
Issue created Jun 07, 2016 by Edward Z. Yang@ezyangDeveloper

Type signatures in patterns not (yet) handled by Template Haskell

This bit me just now, so I figured I should report a feature request bug.

ezyang@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.

Trac metadata
Trac field Value
Version 8.0.1
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Template Haskell
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking