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,248
    • Issues 5,248
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 564
    • Merge requests 564
  • 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
  • #8953
Closed
Open
Issue created Apr 03, 2014 by Richard Eisenberg@raeDeveloper

Reification drops necessary kind annotations

Consider the following:

{-# LANGUAGE DataKinds, PolyKinds, TypeFamilies, TemplateHaskell #-}

import Language.Haskell.TH

type family Poly (a :: k) :: *
type instance Poly (x :: Bool) = Int
type instance Poly (x :: Maybe k) = Double

$( do info <- reify ''Poly
      runIO $ putStrLn $ pprint info
      return [] )

Compiling with HEAD yields this output:

type family Main.Poly (a_0 :: k_1) :: *
type instance Main.Poly x_2 = GHC.Types.Double
type instance Main.Poly x_3 = GHC.Types.Int

The problem is that the type patterns in the reified instances are just plain variables, without their kind annotations. This omission makes the instance declarations unfaithful to the original meaning.

Edited Mar 09, 2019 by Richard Eisenberg
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking