(* Example of function types and variables in ML on page 211 of Kenneth C. Louden, Programming Languages Principles and Practice 2nd Edition Copyright (C) Brooks-Cole/ITP, 2003 *) type IntFunction = int -> int; fun square (x: int) = x * x; val f = square; fun evaluate (g: IntFunction, value: int) = g value; evaluate(f,3); (* evaluates to 9 *)