Comment

Comment by krat0sprakhar

The OCaml version (for 2 lists) is almost as good as clojure

    List.map2 ( + ) a b;;
However, for 3 or more lists, Clojure definitely wins (since there's no variadic equivalent of map in OCaml) -

    let x = List.map2 ( + ) a b in List.map2 ( + ) x c;;
Which got me wondering, is there a particular reason why only a `map2` exists in OCaml?
parent krat0sprakhar 10 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton