以下のセッションの最後に受け取ったエラーについて混乱しています。
$ ghci
GHCi, version 7.10.2: http://www.haskell.org/ghc/ :? for help
Ok, modules loaded: Main.
*Main> :set -XDataKinds
*Main> :t [False, True]
[False, True] :: [Bool]
*Main> :t [False]
[False] :: [Bool]
*Main> :k [False, True]
[False, True] :: [Bool]
*Main> :k [False]
<interactive>:1:2:
Expected kind ‘*’, but ‘False’ has kind ‘Bool’
In a type in a GHCi command: [False]
エラーの理由
今後の実験により、次のことが明らかになります。
*Main> :k [Int]
[Int] :: *
*Main> :k [Int, Int]
[Int, Int] :: [*]
[Int]
値が存在する可能性があるため、親切ですが、親切*
であることにも意味があり[*]
ます。
もう少しデータポイント:
*Main> :k []
[] :: * -> *
*Main> :k [Bool]
[Bool] :: *