Playing with DataKinds - Kind mis-match errors

你说的曾经没有我的故事 提交于 2019-12-05 09:32:10

I think way you are testing is not correct. undefined can be of any type of kind * (I maybe wrong here).

Try this in ghci

ghci>:t (undefined :: 'Z)

<interactive>:1:15:
    Kind mis-match
    Expected kind `OpenKind', but `Z' has kind `Nat'
    In an expression type signature: Z
    In the expression: (undefined :: Z)

You can still get the type of Plus One Two by using :kind! in ghci

ghci>:kind! Plus One Two
Plus One Two :: Nat
= S (S (S 'Z))
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!