| bar :: String -> Int
| bar "ab" = 1
| bar "c"  = 2
| bar _    = 3
| 
| baz :: String -> Int
| baz ('a':'b':[]) = 1
| baz ('c':[])     = 2
| baz _            = 3
| -----------------------------------
| 
| panne@marutea:~/forschung/misc > ghc -Wall -O -c Foo.hs
| 
| Foo.hs:4: Pattern match(es) are overlapped in the definition 
| of function `bar':
|           bar "c" = ...
| 
| Note that there is no warning for baz.  IIRC this has been reported
| and fixed some time ago. Deja vu? Did they change the matrix?  %-)

It's reported regularly, and we never fix it!  (At least I don't 
*think* it was ever fixed.)  The overlap-checking code was written by
Juan Quintela, and none of us have ever got sufficiently up
to speed with it to change it.  What an admission!  If anyone out there
wants to have a go, please do.

Put it on the wish list!

| And another one: -Wall (which includes -fwarn-unused-imports) doesn't
| warn about explicitly imported but unused entities anymore. An example
| can be given if needed.

Ah, that one I understand. I've fixed it in my copy; will check in
hopefully by tonight.

Simon


Reply via email to