bvdeenen icon

ocaml core List.sum

bvdeenen | PRO | 05/04/19 08:52:48 PM UTC | 0 ⭐ | 10049 👁️ | Never ⏰ | []
OCaml |

150 B

|

None

|

0 👍

/

0 👎

#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

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎