Skip to content

Visible kind applications + data family: `U :: Type' said to be of kind `k0 -> k1` in error message

Using the visible kind applications (D5229) (#12045 (closed)) patch.

GHC erroneously calls U :: Type a "function" of kind k0 -> k1 if I understand this right,

$ ghci 
GHCi, version 8.7.20181017: http://www.haskell.org/ghc/  :? for help
Prelude> :set prompt "> "
> import Data.Kind (Type)
>
> :set -XTypeFamilies 
> :set -XTypeApplications
>
> data family   U      :: Type
> data instance U @Int

<interactive>:7:1: error:
    • Cannot apply function of kind ‘k0 -> k1’
      to visible kind argument ‘Int’
    • In the data instance declaration for ‘U’
> 

I expect something like "Cannot apply type U to visible kind argument Int" or

> data instance U Int = MkU

<interactive>:7:1: error:
    • Expected kind ‘* -> *’, but ‘U’ has kind ‘*’
    • In the data instance declaration for ‘U’
> 
Trac metadata
Trac field Value
Version 8.6.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
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