diff --git a/Code CAML.md b/Code CAML.md index 5605088..68c9618 100644 --- a/Code CAML.md +++ b/Code CAML.md @@ -20,11 +20,11 @@ let pos_max lst = if lst = [] then failwith "pos_max: empty list" else - let rec pmr mval mpos cpos = function + let rec pmr mpos cpos = function | [] -> mpos - | e::t -> + | e::mval::t -> if e > mval then - pmr e cpos (cpos + 1) t + pmr cpos (cpos + 1) t else pmr mval mpos (cpos + 1) t in let init_max =