Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • 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,844
    • Issues 4,844
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 453
    • Merge requests 453
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #11485

Closed
Open
Created Jan 24, 2016 by Ryan Scott@RyanGlScottMaintainer

Very unhelpful message resulting from kind mismatch

The following code:

module Foo where

import Data.Typeable

tyConOf :: Typeable a => Proxy a -> TyCon
tyConOf = typeRepTyCon . typeRep

tcList :: TyCon
tcList = tyConOf (Proxy :: Proxy [])

fails because -XPolyKinds is not enabled. But the error message that you get is quite different on GHC 7.10 and 8.0.

On GHC 7.10.3:

[1 of 1] Compiling Foo              ( Foo.hs, Foo.o )

Foo.hs:9:19:
    Couldn't match kind ‘* -> *’ with ‘*’
    Expected type: Proxy a0
      Actual type: Proxy []
    In the first argument of ‘tyConOf’, namely ‘(Proxy :: Proxy [])’
    In the expression: tyConOf (Proxy :: Proxy [])
    In an equation for ‘tcList’: tcList = tyConOf (Proxy :: Proxy [])

But on GHC 8.0.1-rc1:

Foo.hs:9:19: error:                                                                                       
    • Expected kind ‘Proxy []’,                                                                           
        but ‘Data.Proxy.Proxy :: Proxy []’ has kind ‘Proxy []’                                            
    • In the first argument of ‘tyConOf’, namely ‘(Proxy :: Proxy [])’                                    
      In the expression: tyConOf (Proxy :: Proxy [])
      In an equation for ‘tcList’: tcList = tyConOf (Proxy :: Proxy [])
Trac metadata
Trac field Value
Version 8.0.1-rc1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler (Type checker)
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