let len_list x = let rec helper a x = match x with | [] -> a | h::t -> helper (a + 1) t in helper 0 x;; let sum_list x = let rec helper a x = match x with | [] -> a | h::t -> helper (a + h) t in helper 0 x;; let max_list x = let rec helper a x = match x with | [] -> a | h::t -> helper (max a h) t in helper 0 x;; let len_list_fold x = List.fold_left (fun a _ -> a + 1) 0 x let sum_list_fold x = List.fold_left (fun a v -> a + v) 0 x let max_list_fold x = List.fold_left (fun a v -> max a v) 0 x