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'
I suppose that I'm free to ignore D) and use the more IMHO intuitive C) declaration. I thought that I'd ask to make sure that I wasn't missing something in the D) one. TIA ....