In my haste to reply I made an error in my 'newby' multiplication
function. Pesky negative numbers...

  intMul ∷ Integer → Integer → Integer
  intMul x n | n <  0 = -(intMul x $ abs n)
             | n == 0 = 0
             | n >  0 = x + intMul x (n - 1)

I do wonder what happens when haltavista encounters a function that
diverges. Like my original intMul applied to a negative number:
"intMul 2 (-1)".
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to