Quote:

> so '/' in Scheme and in Haskell means a different thing? did not know that.

Actually, it only means different things in Scheme. :-)

Dividing integers and dividing floats (or "real numbers", if you want

to be more mathematical, but rather imprecise) are different things.

In Scheme, being dynamically typed and all, / checks the type of the

arguments when called, and subsequently invokes the proper

implementation. Obviously, this occasionally leads to run time

errors when trying to divide indivisible types.

In Haskell, the types need to be determined at compile time, so we

have no such luxury - we need different functions. Now, the type

class system makes sure we only need two, one for the Fractional

class - fractions, floats, etc. - where you can do exact division

((/)), and one for the Integral class - e.g. integers of various kinds

- where you usually can't do it exactly (div).

(I suppose you could have just one division, but division of

fractionals is related to functions like recip (i.e. 1/x), so it's

probably a sensible division)

-kzm

--

If I haven't seen further, it is by standing in the footprints of giants