GHC-2.10's "overlapping pattern matches"-warnings are sometimes quite puzzling:

------------------------
module Foo where

bar "-"      = 1
bar ('-':xs) = 2
bar _        = 3

baz ('-':[]) = 1
baz ('-':xs) = 2
baz _        = 3
------------------------

Transcript:

   panne@liesl:/tmp > ghc -c Foo.hs
   Foo.hs:3: 
       Warning: Pattern match(es) are overlapped
           in the definition of function `bar'
               `('-' : xs) = ...'
   ghc: module version changed to 1; reason: no old .hi file


Why is there a warning for bar but none for baz?
Apart from this buglet, the new warnings are much more informative.

BTW, what do the "discarding polymorphic case"-warnings mean and
under what circumstances do they occur? I think this has been asked
before, but I could not find the answer in my mail folders...

-- 
Sven Panne                                        Tel.: +49/89/2178-2235
LMU, Institut fuer Informatik                     FAX : +49/89/2178-2211
LFE Programmier- und Modellierungssprachen              Oettingenstr. 67
mailto:[EMAIL PROTECTED]            D-80538 Muenchen
http://www.pms.informatik.uni-muenchen.de/mitarbeiter/panne

Reply via email to