
On Wed, 29 Nov 2017, Sergiu Ivanov wrote:
Hi Henning,
Maybe you can factor out the implementations of different branches into separate functions, like in:
case 0 :: Int of 0 -> putStrLn "A" 1 -> handleOne1 where handleOne1 :: Int -> IO () handleOne1 = putStrLn "B"
handleOne1 :: Int -> IO () handleOne2 = putStrLn "C"
I had something similar in mind and found it too complicated. I could also omit 'case' completely, and directly call handleOne1 and prefix unused handleOne's with an underscore. Maybe it is the best I can do for now.
To me, you are creating overlapping patterns in the case statements, so having unused branches and _not_ having warnings about them kind of breaks the point of this type of warning (personal opinion).
Not quite. We can silence "unused" warnings for variables by prepending an underscore. Something similar might work for case patterns.