Warn if a pattern guard obviates all others
The following code, when compiled with
-Wall, gives no warnings:
module Main where main :: IO () main = print $ foo (10 :: Int) where foo x | True = (20 :: Int) | x == 10 = (30 :: Int)
I would expect that since the pattern guard
| True obviates the following guards, that it would warn about unreachable code. There was a bug in my code today which I tracked down to a code transposition that would have been easily spotted with such a warning.