
28 Sep
2006
28 Sep
'06
6:11 p.m.
Hello,
This particular example we can do with pattern guards
(although it seems that a simple 'case' is more appropriate for this example)
On 9/28/06, Bulat Ziganshin
Hello Conor,
Thursday, September 28, 2006, 10:30:46 PM, you wrote:
gcd x y | compare x y -> LT = gcd x (y - x) GT = gcd (x - y) y gcd x _ = x
mygcd x y | LT <- z = mygcd x (y-x) | GT <- z = mygcd (x-y) y where z = compare x y mygcd x _ = x -Iavor