我正在研究单例类型可以在多大程度上模拟依赖类型并且我遇到了一个问题。我复制错误的最小代码是:
{-# LANGUAGE GADTs #-}
{-# LANGUAGE TypeInType #-}
import Data.Kind(Type)
data SBool :: Bool -> Type where
STrue :: SBool 'True
SFalse :: SBool 'False
data SSBool :: SBool b -> Type where
SSFalse :: SSBool 'SFalse
SSTrue :: SSBool 'STrue
错误信息是:
预期种类 'SBool b',但 ''SFalse' 有种类 'SBool 'False'</p>