Re: Exhaustive Pattern-Matching

2003-08-30 Thread Marcin 'Qrczak' Kowalczyk
Dnia czw 28. sierpnia 2003 16:37, Frank Atanassow napisa: SML has the same limitations w.r.t. guards as Haskell; Haskell compilers can and do check exhaustiveness, but not redundancy because matches are tried sequentially. I believe SML matching is also sequential. If there is a difference

RE: Exhaustive Pattern-Matching

2003-08-29 Thread Simon Marlow
On Wed, Aug 27, 2003 at 04:57:27PM +0100, Simon Marlow wrote: GHC tries to do so, but sometimes gets it wrong. See the -fwarn-incomplete-patterns flag. We'd appreciate it if someone could overhaul this code - it's been on the wish list for a long time. As a matter of curiosity,

Re: Exhaustive Pattern-Matching

2003-08-29 Thread Christian Maeder
GHC tries to do so, but sometimes gets it wrong. See the -fwarn-incomplete-patterns flag. We'd appreciate it if someone could overhaul this code - it's been on the wish list for a long time. Indeed, I always try to avoid all warnings in my sources by using the flag -Wall, because I consider

Re: Exhaustive Pattern-Matching

2003-08-29 Thread Ketil Z. Malde
Christian Maeder [EMAIL PROTECTED] writes: Indeed, I always try to avoid all warnings in my sources by using the flag -Wall, because I consider this to be good programming style. (In particular warnings about unused and shadowed variables prevented a lot of errors.) However some warnings are

Re: Exhaustive Pattern-Matching

2003-08-29 Thread Alastair Reid
Back when I hacked on Hugs routinely, I thought of detecting uncaught cases including things like the following: f :: Color - String f x = case x of Red - r _ - ++ case x of Green - g Blue - b Warning: Pattern match(es) are

Re: Exhaustive Pattern-Matching

2003-08-29 Thread Andrew J Bromage
G'day all. On Wed, Aug 27, 2003 at 04:57:27PM +0100, Simon Marlow wrote: GHC tries to do so, but sometimes gets it wrong. See the -fwarn-incomplete-patterns flag. We'd appreciate it if someone could overhaul this code - it's been on the wish list for a long time. As a matter of curiosity,

Re: Exhaustive Pattern-Matching

2003-08-28 Thread Steffen Mazanek
Thank you all for your help. I will try this ghc-flag. It is interesting as well, that in contrast to Haskell Standard ML ensures, that pattern-matches are exhaustive and irredundant. Ciao, Steffen ___ Haskell mailing list [EMAIL PROTECTED]

Re: Exhaustive Pattern-Matching

2003-08-28 Thread Frank Atanassow
On Thursday, Aug 28, 2003, at 08:47 Europe/Amsterdam, Steffen Mazanek wrote: Thank you all for your help. I will try this ghc-flag. It is interesting as well, that in contrast to Haskell Standard ML ensures, that pattern-matches are exhaustive and irredundant. SML has the same limitations

RE: Exhaustive Pattern-Matching

2003-08-27 Thread Simon Marlow
I have a question about pattern-matching. In the Haskell-report it is not postulated, that pattern matching has to be exhaustive. Would it be possible at all to implement an algorithm, which checks Haskell-style patterns for exhaustiveness? What kinds of complication can be expected?

Re: Exhaustive Pattern-Matching

2003-08-27 Thread Iavor Diatchki
hello, Steffen Mazanek wrote: Hello, I have a question about pattern-matching. In the Haskell-report it is not postulated, that pattern matching has to be exhaustive. Would it be possible at all to implement an algorithm, which checks Haskell-style patterns for exhaustiveness? What kinds of