{-# LANGUAGE DataKinds, ExistentialQuantification, KindSignatures #-}
import Data.Proxy
data Type t= forall (a :: t). Type (Proxy a)
Type variable ‘t’ used in a kind
In the kind ‘t’
In the definition of data constructor ‘Type’
In the data declaration for ‘Type’
但是t
是一类变量,而不是一个类型变量。这是怎么回事?
你还不能在具体语法混合类型和种类。你可以做的最好的就是数据类型(tp :: KProxy t)= forall(a :: t)。类型(代理a)'(尽管我没看到这个数据类型会有多么有用,但这完全是一个不同的问题。 – user2407038