fun memb(x, []) = false | memb(x, y::L) = if x = y then true else memb(x,L);For each of the following expressions, say what is the result (true, false, or error). Remember that the two arguments of "=" must have the same type, and that it must be an equality type.
datatype tree = Leaf of int | Node of (tree * int * tree); fun f (Leaf n) = [n] | f (Node(t1,n,t2)) = (f t1) @ (n::(f t2));Say what is the semantics of f (only one answer, please)
fun map(f, []) = [] | map(f, x::L) = (f x) :: (map(f,L));Say what is the result of the following expression (only one answer, please)
map( fn (x,y) => if x < y then y else x , [(2,1),(3,4),(5,6)] )