> runRandom last max num
> | num > 1     = runRandom (fst new) max (num-1)
> | otherwise   = snd new

> What's the difference between the pipe-syntax, and a case statement,
> i.e. writing the function as

>    runRandom last max num = case num of
>       1 -> runRandom ....
>       otherwise -> snd new

Eeek!  This is not the same function!  (num>1)  =/=  (num==1)
Oh, and it isn't type-correct either.
Try:

     runRandom last max num = case num>1 of
        True -> runRandom ....
        otherwise -> snd new

Oops.  No.  Try again:

     runRandom last max num = case num>1 of
        True -> runRandom ....
        False -> snd new

That's better.  These transformations by hand can be tricky, huh?
Regards,
    Malcolm

_______________________________________________
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell

Reply via email to