在 GHCi 中,为什么函数箭头 `:kind (->)` 的类型包含问号 `(->) :: ?? -> ? -> *`?
在 GHCi(版本 7.0.2)中,如果我询问函数类型的种类,结果有问号:
Prelude> :kind (->)
(->) :: ?? -> ? -> *
Why does the kind include Question Marks without just asterisks * -> *-> *?问号是什么意思?为什么其他类型只使用星号?
Prelude> :kind (,)
(,) :: * -> * -> *
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 (,)
(,) :: * -> * -> *
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
?
和??
类型指的是 GHC 扩展,特别是未装箱的类型。 http://hackage.haskell.org/trac/ghc/wiki/IntermediateTypes有一个图表显示扩展类型?
(所有可能的类型)、#
(未装箱类型)、??
(装箱或普通未装箱)之间的关系types — “#
和*
的最小上界”),(#)
(未装箱的元组,只能少量使用的上下文)。 (标准类型*
指的是普通的盒装类型。)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.)