Possible Duplicate:
Haskell Weird Kinds: Kind of (->) is ?? -> ? -> *可能重复:Haskell奇怪的种类:种类( - >)是?? - >? - > *
In GHCi (version 7.0.2), if I ask for the kind of the function type, the result has question marks:
在GHCi(版本7.0.2)中,如果我要求函数类型的类型,结果有问号:
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 (,)
(,) :: * -> * -> *
1 个解决方案
#1
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.)
的?和?? kind指的是GHC扩展,特别是未装箱的类型。 http://hackage.haskell.org/trac/ghc/wiki/IntermediateTypes有一个图表显示扩展种类之间的关系? (所有可能的类型),#(未装箱的类型),?? (盒装或普通的未装箱类型 - “#和*的最小上限”),(#)(未装箱的元组,只能在少量上下文中使用)。 (标准种类*指正常的盒装类型。)
#1
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.)
的?和?? kind指的是GHC扩展,特别是未装箱的类型。 http://hackage.haskell.org/trac/ghc/wiki/IntermediateTypes有一个图表显示扩展种类之间的关系? (所有可能的类型),#(未装箱的类型),?? (盒装或普通的未装箱类型 - “#和*的最小上限”),(#)(未装箱的元组,只能在少量上下文中使用)。 (标准种类*指正常的盒装类型。)