fun f x y = x + y fun loop (n, a, b) = if n = 0 then a 5 else loop (n - 1, b, f 3) val _ = loop (100, fn _ => raise Overflow, f 9)