试图创建一个基类,我可以从中派生出不同的类型.以下是什么问题?
class (Eq a) => MyClass a
data Alpha = Alpha
instance MyClass Alpha where
Alpha == Alpha = True
Run Code Online (Sandbox Code Playgroud)
我收到错误:
test.hs:5:10: `==' is not a (visible) method of class `MyClass'
Failed, modules loaded: none.
Run Code Online (Sandbox Code Playgroud)