
31 Jan
2017
31 Jan
'17
12:11 p.m.
I think the best solution here would be a new warning, say -fwarn-wildcard-patterns. This would be a simple syntactic check for a wildcard pattern anywhere in the module.
Note that case <foo> | [] -> ... | (_ : xs) -> ... also contains a wildcard-pattern. So emitting a warning for every use of wildcard patterns would likely lead to a lot of pain. You'd instead want to warn about "default branch", e.g. case <foo> | [] -> ... | (1 : xs) -> ... | (_ : xs) -> ... here the wildcard pattern does correspond to a "default branch" and might hence deserve a warning. Stefan