On 03/02/2026 00:07, Jeremy Dawson wrote:
btw - another inconsistency between compilers
- fun square x = x * x;
val square = fn : int -> int
ie Moscow ML assumes int as a sort of default
The default type for an overloaded operator, other than /, is defined to be int, so every compiler ought to treat it that way. The definition is vague on how much context to use in determining overloading. Poly/ML uses the whole "topdec"; other compilers require the overloading to be resolved within the function definition.
David