Skip to content

GitLab

  • Menu
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 4,976
    • Issues 4,976
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 479
    • Merge requests 479
  • 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 Compiler
  • GHCGHC
  • Issues
  • #11046
Closed
Open
Created 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
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking