Yes, itβs still true, but you can get around this using error .
f (Just a) = show a
without a case for Nothing gives warnings but adds
f Nothing = error "f: Nothing supplied as an argument. This shouldn't have happened. Oops."
gets rid of the warning.
The solution to every task of your task is to give Haskell some code that you think will never be run so that it is quiet.
Please note: I believe that your code should be reliable and cover every possible situation if you cannot prove that this will never happen. I think that work on this restriction is not a good practice.
(You might think that this is a wide-open back door to crack a useful compile-time check and should be stopped with -Wall , but I can confuse my circle with any simple restriction that you would choose, and I think the complete solution to this is problems will essentially solve the problem of stopping, so you should not blame the compiler.)
source share