Re: Pattern matching for solitary constructors

1996-11-04 Thread Fergus Henderson
[EMAIL PROTECTED] wrote: > data D2 = D2 Int Int > > d2 (D2 i1 i2) = 42 > > d2' ~(D2 i1 i2) = 42 [...] > If d2 (D2 undefined undefined) == 42, we have to implement d2 in the > same (less efficient) way that we implement d2' under the current > semantics. How do you implement d2', and why

Why not make "gcd 0 0 = 0"?

1996-11-04 Thread Marnix Klooster
Hello, I just noticed that the Haskell Report leaves "gcd 0 0" undefined. Why is that? I think the gcd of 0 and N should be |N|, the absolute value of N. Haskell currently does just that, except when N=0: the result of "gcd 0 0" is undefined instead of 0. I propose to remedy this, but let me f