How to combine case statement patterns [duplicate]
问题 This question already has answers here : Haskell syntax for 'or' in case expressions (5 answers) Closed 4 years ago . I'm trying to match on many different constructors in a case statement. For simplicity, assume in half the cases we do the same thing, and in the other half we do something else. Even if I factor out the logic to another function, I still have to write: case x of C1 -> foo x C2 -> foo x ... C10 -> bar x C11 -> bar x ... Is there some way to make case statements behave more