Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 (,)
(,) :: * -> * -> *
like image 788
wl. Avatar asked Mar 19 '11 02:03

wl.


1 Answers

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

like image 189
geekosaur Avatar answered Nov 07 '22 01:11

geekosaur