开发者

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

This question already has an answer here: Closed 10 years ago.

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 (,)
(,) :: * -> * -> *


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜