Examples of Type Inference in Function Definitions
Full declaration of argument and return types by the programmer:
fun foo(x:int):int = x + 100;
val fun = fn : int -> int
Inference from the type of one operand:
val foo = fn : int -> int
Inference from the return type:
fun foo2(x,y):real = x + (y * y);
val foo2 = fn : real * real -> real