Not surprisingly, the sum of two lists is just as nice in Haskell:
zipWith (+) a b
... and things get a little bit hairy with three lists:
zipWith3 (\x y z -> x + y + z) a b c
... which is still nice but for four lists we get to the same point as OCaml:
let a' = zipWith (+) a b in zipWith3 (\x y z -> x + y + z) a' c d
I guess in both OCaml and Haskell the user is expected to define zipWith4, zipWith5, etc. (or map in OCaml's case) if he fells the need to use them.
There is probably a simple and elegant way to get variadic-like behavior in Haskell by folding list of list, or playing with Foldable and Sum, but it's a little bit to early in the morning for me to generalize it.
There is probably a simple and elegant way to get variadic-like behavior in Haskell by folding list of list, or playing with Foldable and Sum, but it's a little bit to early in the morning for me to generalize it.