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 <[EMAIL PROTECTED]> 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
_______________________________________________
Haskell-prime mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-prime

Reply via email to