[Haskell-cafe] More death to partial functions: Should -fwarn-incomplete-uni-patterns be enabled with -Wall?

Joachim Breitner mail at joachim-breitner.de
Sun Nov 8 08:36:13 UTC 2015

Hi Niklas,

Am Sonntag, den 08.11.2015, 01:10 +0100 schrieb Niklas Hambüchen:
> In an older mail from 2010
> (https://mail.haskell.org/pipermail/glasgow-haskell-users/2010-Septem
> ber/019237.html)
> I saw Simon mention that it wasn't planned to warn about inexhaustive
> patterns like this.

note that in that mail, he refers to patterns in where clauses, which
is a different use-case than the lambdas you refer to.

GHC is a large code base that traditionally is kept -Wall clean. You
could make your proposal a bit more substantial by compiling GHC with
-fwarn-incomplete-uni-patterns on and see what breaks, what the usual
use-cases are, how to change the code to make it clean again.

Then you are in a good position to argue that it is an improvement (or
you will find that SPJ, as very often, has a good instinct and making
it warn about that prohibits many useful idioms.)

Personally, I’m sympathetic to “he who uses -Wall gets to jump through
hoops”, but incomplete where patterns that bind variables that are not
used in all cases are useful...


Joachim “nomeata” Breitner
  mail at joachim-breitner.dehttp://www.joachim-breitner.de/
  Jabber: nomeata at joachim-breitner.de  • GPG-Key: 0xF0FBF51F
  Debian Developer: nomeata at debian.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20151108/74f802e2/attachment.sig>

More information about the Haskell-Cafe mailing list