我正在使用-XExistentialQuantification
GHC 扩展为特定类型类 ( Shape
) 的值创建异构容器:
-- Container type
data Object = forall a. Shape a => Object a
-- 'Shape' class. Methods not important
class Eq s => Shape s where
doStuff :: s -> s
鉴于 的所有实例Shape
也是 的实例Eq
,有没有办法也创建Object
一个实例Eq
?