[(Type,Type)] 种类的居民是什么?
What are the inhabitants of the [(Type,Type)] kind?
在 ghci (8.2) 上,
:k ('[] :: [(Type,Type)])
成功,但是
:k ('[(Bool,Bool)] :: [(Type,Type)])
不会,因为 (Bool,Bool)(或什至 ('True,False') 之类的东西)有种类 *.
我知道问题出在构造 * 类型的 (,) 构造函数上。
在类型级别表示强类型对列表的方法是什么?
你漏掉了一个反引号,:k ('[ '(Bool,Bool)] :: [(Type,Type)])
有效。您需要提升的元组构造函数和提升的列表构造函数。
在 ghci (8.2) 上,
:k ('[] :: [(Type,Type)])
成功,但是
:k ('[(Bool,Bool)] :: [(Type,Type)])
不会,因为 (Bool,Bool)(或什至 ('True,False') 之类的东西)有种类 *.
我知道问题出在构造 * 类型的 (,) 构造函数上。
在类型级别表示强类型对列表的方法是什么?
你漏掉了一个反引号,:k ('[ '(Bool,Bool)] :: [(Type,Type)])
有效。您需要提升的元组构造函数和提升的列表构造函数。