fun elim(x, []) = []
| elim(x, y::L) = if x = y then elim(x,L) else y::(elim(x,L));
For each of the following expressions, say what is the result (including error).
Remember that the two arguments of "=" must have the same type, and that it must be an equality type.
datatype tree = empty | node of (tree * int * tree);
fun f empty = empty
| f (node(empty,n,empty)) = empty;
| f (node(t1,n,t2)) = node(f t1, n, f t2);
Say what is the semantics of f (only one answer, please)
fun reduce(f, v, []) = v
| reduce(f, v, x::L) = f(x, reduce(f,v,L));
fun max [] = 0
| max (x::L) = let y = max L in if x > y then x else y end;
Say what is the result of the following
expression (only one answer, please)
reduce(max, 0, [[1,2],[3],[4],[5,6]]);