Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,249
    • Issues 4,249
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 391
    • Merge Requests 391
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #11046

Closed
Open
Opened Nov 01, 2015 by oerjan@nvg.ntnu.no@trac-oerjan

lookupTypeName does not support type operators not starting with :

The following non-working code (minus a missing import) was posted on stackoverflow:

IssueTH.hs:

{-# LANGUAGE TemplateHaskell #-}
module IssueTH where
import Language.Haskell.TH

f :: Q [Dec]
f = do
    Just n <- lookupTypeName "GHC.TypeLits.*"
    return []

Issue.hs:

{-# LANGUAGE TemplateHaskell #-}
module Issue where
import IssueTH
import GHC.TypeLits

$f

ghc Issue.hs fails with message: Pattern match failure in do expression at IssueTH.hs:7:5-10

This gives no error if * is replaced by an alphanumeric type like Nat. Similar tests seem to fail whenever attempting to look up a type operator with lookupTypeName.

Trac metadata
Trac field Value
Version 7.10.2
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Template Haskell
Test case
Differential revisions
BlockedBy
Related
Blocking
CC oerjan
Operating system
Architecture
Edited Mar 10, 2019 by oerjan@nvg.ntnu.no
Assignee
Assign to
8.2.1
Milestone
8.2.1 (Past due)
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#11046