标签: haskell
如何根据数据类型进行模式匹配?
data Fruit = Apple | Banana | Orange isYellow :: Fruit -> Bool isYellow x | x == Banana = True | otherwise = False