假设我有以下代码:
class Eq (Foo a) => Bar a where
type Foo a :: *
doSmth:: Proxy a -> Foo a -> Bool
doSmth _ a = a == a
在GHC 7中它工作正常,但GHC 8抱怨:
• No instance for (Eq (Foo a)) arising from a use of ‘==’
• In the expression: a == a
In an equation for ‘doSmth’: doSmth _ a = a == a
如何说Foo a
始终是Eq
的实例?