I have the next code:
datatype expr = K of string| Number2 of expr * (expr list);
datatype number = Number1 of string | Number3 of int;
fun append (nil, l2) = l2
| append (x::xs, l2) = x::append(xs, l2);
fun map [] = []
| map (h::t) = (What h)::(map t);
fun What (K x) = [Number1(x)]
|What (Number2 (t,[])) = Number3(0)::What(t)
|What (Number2 (y,a::b)) = append(What(a), map(b));
It doesn't recognize the function "What".(unbound variable or constructor). How can I fix it, that it will know the function "What"?
Thanks.