{-# 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