29 Sep
2006
29 Sep
'06
6:11 a.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 <bulat.ziganshin@gmail.com> wrote:
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