我想在 Haskell 模式匹配中用一个表达式匹配多个条件。
例如,
data Message = HELLO | HI | GOODBYE | BYE greeting x = case x of HELLO or HI -> "hello" GOODBYE or BYE -> "bye"
但我找不到如何做到这一点。
对不起我糟糕的英语。谢谢你。
haskell pattern-matching
haskell ×1
pattern-matching ×1