[MLton-user] Compiler Bug?

Peter Sestoft sestoft@dina.kvl.dk
Wed, 13 Jul 2005 15:27:14 +0200 (CEST)


On Wed, 13 Jul 2005, Claudio Russo wrote:

> I think MLton is actually correct, and Moscow ML is wrong. According
  to the Revised Definition of Standard ML, real is not an equality
  type (though it used to be in original SML).

That's true.

Type real was made a non-equality type because one wanted to prevent
naive programmers from testing convergence by r=0.0 in numeric code,
which of course wouldn't work as intended.

On the other hand, real (IEEE854) represents the integers up to 10^15
exactly, and the equality test make excellent sense for them, so at
the time I preferred not to implement that change in Moscow ML.

Peter