Re[2]: Case split uncovered patterns in warnings or not?

2021-11-09 Thread Sebastian Graf
I agree in principle, but then what about data types with strict fields? E.g. data SMaybe a = SNothing | SJust !a f :: SMaybe Bool -> () f SNothing = () Today, we'd suggest `SJust _`. But the checker can't differentiate between evaluation done by a pattern-match of the user vs. something

Re: Case split uncovered patterns in warnings or not?

2021-11-09 Thread Richard Eisenberg
Maybe the answer should depend on whether the scrutinee has already been forced. The new output ("We now say", below) offers up patterns that will change the strictness behavior of the code. The old output did not. Reading the link below, I see that, previously, there was an inconsistency with

Case split uncovered patterns in warnings or not?

2021-11-09 Thread Sebastian Graf
Hi Devs, In https://gitlab.haskell.org/ghc/ghc/-/issues/20642 we saw that GHC >= 8.10 outputs pattern match warnings a little differently than it used to. Example from there: {-# OPTIONS_GHC -Wincomplete-uni-patterns #-}foo :: [a] -> [a]foo [] = []foo xs = ys where (_, ys@(_:_)) = splitAt 0