ocaml core List.sum
bvdeenen May 4th, 2019 94 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- #require "core";;
- open Core;;
- let sum a = List.sum (module Int) a ~f:ident in List.range 0 100 |> List.map ~f:(fun x -> x*x) |> sum;;
- - : int = 328350
RAW Paste Data