In GHCi, why does the kind of the function arrow `:kind (->)` include question marks `(->) :: ?? -> ? -> *`? [duplicate]

StackOverflow https://stackoverflow.com/questions/5359707

  •  27-10-2019
  •  | 
  •  

Question

Possible Duplicate:
Haskell Weird Kinds: Kind of (->) is ?? -> ? -> *

In GHCi (version 7.0.2), if I ask for the kind of the function type, the result has question marks:

Prelude> :kind (->)
(->) :: ?? -> ? -> *

Why does the kind include question marks instead of just asterisks * -> * -> *? What do the question marks mean? Why do other types just use asterisks?

Prelude> :kind (,)
(,) :: * -> * -> *
Was it helpful?

Solution

The ? and ?? kinds refer to GHC extensions, specifically unboxed types. http://hackage.haskell.org/trac/ghc/wiki/IntermediateTypes has a diagram showing relationships between the extended kinds ? (all possible types), # (unboxed types), ?? (boxed or normal unboxed types — "least upper bound of # and *"), (#) (unboxed tuples, which can only be used in a small number of contexts). (The standard kind * refers to normal boxed types.)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top