Tail Recursion and Exception Handling
Can we use tail recursion elimination to optimize the following program?
exception OddNum;
let fun f(0,count) = count
| f(1, count) = raise OddNum
| f(x, count) = f(x-2, count+1) handle OddNum => -1
Why or why not? Explain. This is a tricky situation - try to explain succinctly what the issues are and how they might be resolved.