On 1/29/2026 6:18 PM, Duke Normandin wrote:
Taken from Paulson's book: Chap2.4
A) fun square x = x * x;
Error- Unable to resolve overloading for *
I understand the above!
B) fun square(x : real) = x * x; I understand: x is declared as a real
C) fun square x = x * x : real; I see this as declaring a function w/o parentheses AND that the r_result_ is a 'real'
I have a problem with this declaration:
D) fun square x : real = x * x; I see this as declaring a function w/o parentheses, AND declaring x to be a 'real' I do NOT see/understand that this syntax indicates that the type of the _result_ is a 'real'
The type of the result is a real by implication of what * does on reals, i.e., it produces a real.
Eliot Moss