A last example
datatype expr = INT of int
| UNARY of string * expr
| BINARY of string * expr * expr
fun print(INT n) = Int.toString(n)
| print(UNARY(s, e)) =
``('' ^ s ^ print(e) ^ ``)''
| print(BINARY(s, e1, e2)) =
``('' ^ print(e1) ^ s ^
print(e2) ^ ``)''
print(BINARY(``*'', INT 5, BINARY(``+''
UNARY(``-'', INT 3), INT 4)))