haskell/containers — pull request #84 by treeowl (2014-12-03 13:30:38+00:00)
Title: Make zipWith faster

Make `zipWith` build its result with the structure of its first
argument, splitting up its second argument as it goes. This allows
fast random access to the elements of the results immediately,
without having to build large portions of the structure. It also
seems to be slightly faster than the old implementation when the
entire result is used, presumably by avoiding rebalancing costs.
I believe most of this code will also help implement a fast
`(<*>)`.

Use the same approach to implement `zipWith3` and `zipWith4`.

Clean up a couple warnings.

Many thanks to Carter Schonwald for suggesting that I use the
structure of the first sequence to structure the result, and for
helping me come up with the `splitTraverse` approach.