我知道我可以Bool
像这样提升到善良的水平,Bool
可能在哪里True
或False
:
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeFamilies #-}
type family TF t :: Bool
type instance TF Int = True
type instance TF Bool = False
我想推广()
,当然只有一个价值()
。但这似乎不起作用:
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeFamilies #-}
type family TF t :: ()
type instance TF Int = ()
type instance TF Bool = ()
我想我可以只使用Bool
and True
,但是有没有一种可以提升到 kind 级别的单值类型?