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,262
    • Issues 4,262
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 404
    • Merge Requests 404
  • 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
  • #1849

Closed
Open
Opened Nov 07, 2007 by guest@trac-guest

Template Haskell: reify is not consistent with the special constructors ListT and TupleT

While reify provides consistent type information for arrows (i.e. returns the special ArrowT constructor and not ConT "GHC.Prim.(->)"), that doesn't happen with ListT and TupleT.

Prelude> :m +Language.Haskell.TH
Prelude Language.Haskell.TH> let seeType n = do {VarI _ t _ _ <- reify n; runIO $ putStrLn $ show t; [|1|]}
Prelude Language.Haskell.TH> let {f = undefined :: Int -> Int; g = undefined :: [Int]; h = undefined :: (Int, Int)}
Prelude Language.Haskell.TH> $(seeType (mkName "f"))
AppT (AppT ArrowT (ConT GHC.Base.Int)) (ConT GHC.Base.Int)
AppT (AppT ArrowT (ConT GHC.Base.Int)) (ConT GHC.Base.Int)
AppT (AppT ArrowT (ConT GHC.Base.Int)) (ConT GHC.Base.Int)
AppT (AppT ArrowT (ConT GHC.Base.Int)) (ConT GHC.Base.Int)
1
Prelude Language.Haskell.TH> $(seeType (mkName "g"))
AppT (ConT GHC.Base.[]) (ConT GHC.Base.Int)
AppT (ConT GHC.Base.[]) (ConT GHC.Base.Int)
AppT (ConT GHC.Base.[]) (ConT GHC.Base.Int)
AppT (ConT GHC.Base.[]) (ConT GHC.Base.Int)
1
Prelude Language.Haskell.TH> $(seeType (mkName "h"))
AppT (AppT (ConT Data.Tuple.(,)) (ConT GHC.Base.Int)) (ConT GHC.Base.Int)
AppT (AppT (ConT Data.Tuple.(,)) (ConT GHC.Base.Int)) (ConT GHC.Base.Int)
AppT (AppT (ConT Data.Tuple.(,)) (ConT GHC.Base.Int)) (ConT GHC.Base.Int)
AppT (AppT (ConT Data.Tuple.(,)) (ConT GHC.Base.Int)) (ConT GHC.Base.Int)
1

For g and h the expected returned types are:

AppT ListT (ConT GHC.Base.Int)
AppT (AppT (TupleT 2) (ConT GHC.Base.Int)) (ConT GHC.Base.Int)
Trac metadata
Trac field Value
Version 6.8.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system Unknown
Architecture Unknown
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#1849