-fwarn-incomplete-patterns, not always warns

Neil Mitchell ndmitchell at gmail.com
Thu Dec 1 15:56:29 EST 2005


I have been playing around with -fwarn-incomplete-patterns under GHC
6.4.1 on Windows.

-- no warning
ex1 x = ss
    where (s:ss) = x

-- no warning
ex2 x = let (s:ss) = x in ss

--    Warning: Pattern match(es) are non-exhaustive
--             In a case alternative: Patterns not matched: []
ex3 x = case x of ~(s:ss) -> ss

I have translated all 3 functions using the rules supplied in the
Haskell 98 report, so they all have the same meaning, but only one
gives an error. Is it intentional to ignore where/let pattern matches?



More information about the Glasgow-haskell-users mailing list