[Haskell-cafe] Re: default for quotRem in terms of divMod?

Henning Thielemann lemming at henning-thielemann.de
Sun Aug 12 08:01:24 EDT 2007


On Sun, 12 Aug 2007, Lennart Augustsson wrote:

> CPU design cannot be changed, because they implement well defined ISA.

What is ISA? Why is it not possible to add CPU functions for `div` and
`mod`?

> The only processor I know of (NS 32k) with a different division is long
> dead.

If efficiency on current CPUs is the only advantage of `quot` and `rem`,
then for future versions of Haskell I propose to fix these functions to
the type Int rather than making them class methods. For non-machine types
like Integer the efficiency argument does certainly not hold.


More information about the Haskell-Cafe mailing list