Exhaustive Pattern-Matching

Frank Atanassow franka@cs.uu.nl
Thu, 28 Aug 2003 16:37:04 +0200


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 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 between the two, it must have to 
do with laziness.

Regards,
Frank