my-solutions/codewars/ocaml/fundamentals/sum-of-positive/main.ml

3 lines
83 B
OCaml
Raw Normal View History

let positive_sum ls =
List.fold_left ( + ) 0 (List.filter (fun x -> x > 0) ls);;