【发布时间】:2022-12-15 05:44:40
【问题描述】:
我正在关注教程并找到了这段代码:
data A = B | C deriving(Eq)
class K a where
f :: a -> Bool
instance K A where
f x = x == C
f _ = False
call = f B
为什么我需要 f _ = False ?
没有它我得到相同的结果。
也许有人有解释。
谢谢你。
【问题讨论】:
标签: class haskell declaration