Non-exhaustive pattern match(es) warning in lambda functions

Christian Maeder Christian.Maeder at dfki.de
Tue Nov 16 11:57:36 EST 2010


Am 16.11.2010 17:49, schrieb Christian Maeder:
> What was the name of the flag for ghc-7.0.1?
> 
> I did not find it in the documentation. -fwarn-incomplete-patterns does
> not work for my lambda expressions.

-fno-warn-incomplete-patterns works! (Unfortunately not for lambda
abstractions, separately.)

Christian

> 
> Cheers Christian
> 
> Am 22.09.2010 18:05, schrieb Simon Peyton-Jones:
>> Good point. Simon and I have decided we agree.  I'll push a patch shortly.
>>
>> S
>>
>> | -----Original Message-----
>> | From: glasgow-haskell-users-bounces at haskell.org [mailto:glasgow-haskell-
>> | users-bounces at haskell.org] On Behalf Of Mitar
>> | Sent: 21 September 2010 07:44
>> | To: glasgow-haskell-users
>> | Subject: Non-exhaustive pattern match(es) warning in lambda functions
>> | 
>> | Hi!
>> | 
>> | Why GHC does not warn (with -Wall) about non-exhaustive pattern
>> | match(es) warning in lambda functions? For example, this code:
>> | 
>> | data Foo = Bar | Baz
>> | 
>> | test1 :: Foo -> IO ()
>> | test1 Bar = return () -- Pattern match(es) are non-exhaustive warning, OK
>> | 
>> | test2 :: Foo -> IO ()
>> | test2 = \Bar -> return () -- No pattern match(es) are non-exhaustive, BAD
>> | 
>> | I think it would be quite useful to also catch such situations and
>> | issue a warning.
>> | 
>> | 
>> | Mitar


More information about the Glasgow-haskell-users mailing list