When I was experimenting with Haskell kinds, and trying to get the kind of ->, and this showed up:
$ ghci
...
Prelude> :k (->)
(->) :: ?? -> ? -> *
Prelude>
Instead of the expected * -> * -> *.
What are the ?? and ? things? Do they mean concrete types or “kind variables”? Or something else?
These are GHC-specific extensions of the Haskell kind system. The Haskell 98 report specifies only a simple kind system:
GHC extends this system with a form of kind subtyping, to allow unboxed types, and to allow the function construtor to be polymorphic over kinds. The kind lattice GHC supports is:
Defined in ghc/compiler/types/Type.lhs
In particular:
Where in the last example
t :: ??(i.e. is not an unboxed tuple). So, to quote GHC, “there is a little subtyping at the kind level”.For interested souls, GHC also supports coercion types and kinds (“type-level terms which act as evidence for type equalities”, as needed by System Fc) used in GADTs, newtypes and type families.