[back]

Function Maximum

Implement the function

val fun_max : (int -> int) list -> int -> int

so that fun_max fs x is \(\max\left(\max_{f \in \mathtt{fs}}\{f(\texttt{x})\}, 0\right)\).

Examples

let _ = assert (fun_max [(+) 1; fun x -> x * x] 1 = 2)
let _ = assert (fun_max [(+) 1; fun x -> x * x] (-2) = 4)