Open ckoster22 opened 7 years ago
I just came across a situation where this compiler error wouldn't be helpful as described above. I had a relatively large union type and I had a case statement that looked something like this.
case myUnionType of
option1 ->
-- do something
option2 ->
-- do something else
_ ->
-- do something else for options 3 thru 10
In that situation, it'd be annoying for the compiler tell me the _
pattern is partially redundant.
I'm conflicted because I think the compiler error in the above post would be useful but the same compiler error in this post would be a nuisance.
I'll leave this issue open for now and see what others think.
I noticed this when pattern matching with Maybes. Here's a SSCCE.
The second branch could only match on
Increment Nothing
since the firstIncrement (Just num)
branch takes care of the Just case.I'd expect an error from the compiler, such as: