Does Haskell provide an idiom for pattern matching against many possible data constructors?
问题 Working on a Haskell project, I'm dealing with the Event data type from the FSNotify package. The constructors for Event are all: Added FilePath UTCTime Modified FilePath UTCTime Removed FilePath UTCTime In my code, I'm only interested in extracting the FilePath from the Event and doing the same action regardless of the type constructor; because of this, I'm tempted to make a lambda. Unfortunately, the code suffers reduced readability when I drop a case expression into the lambda to pattern