18

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 (,)
(,) :: * -> * -> *
Community
  • 1
  • 1
wl.
  • 2,270
  • 3
  • 18
  • 13
  • 1
    IMO, I would like it more, if GHC would only display these extended contexts if a special pragma is given to GHCi, as they confuse the beginner. – fuz Mar 19 '11 at 10:59
  • 1
    See also Don Stewart's more detailed explanation [here](http://stackoverflow.com/questions/3034264/haskell-weird-kinds/3034295#3034295). – Travis Brown Mar 19 '11 at 14:34

1 Answers1

16

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.)

geekosaur
  • 59,309
  • 11
  • 123
  • 114