Here are some use cases that having a reducer would help with:
```elixir
Enum.zip([:a, :b, :c], [1, 2, 3], %{}, fn k, val, acc -> Map.put(acc, k, val) end)
# %{a: 1, b: 2, c: 3}
def zip_into_map(left, right) do
Enum.zip(left, right, %{}, fn k, val, acc -> Map.put(acc, k, val) end)
end
csv_headers = ["id", "date", "whatever"]
Enum.map(csv_rows, fn row ->
zip_into_map(csv_headers, row)
end)
dot_product =
Enum.zip([1, 2], [3, 4], [], fn l, r, acc -> [ l * r | acc] end)
|> Enum.reverse
def zip_merge_values(left, right) do
Enum.zip(left, right, %{}, fn
{key, left_val}, {key, right_val}, acc ->
Map.put(acc, key, left_val ++ right_val)
{left_key, left_val}, {right_key, right_val}, acc ->
Map.merge(acc, %{left_key => left_val, right_key => right_val})
end)
end
zip_merge_values(%{a: [1], c: [5]}, %{a: [2], b: [7])
# %{a: [1, 2], b: [7] c: [5]}
Enum.zip_with(["a", "key", "list"], Stream.repeatedly(fn -> 10 end), %{}, fn k, v, acc ->
Map.merge(acc, {k, v})
end)
# => %{"a" => 10, "key" => 10, "list" => 10}
```
Though I think if we are really going for it if you had a Zippable protocol a la Eumerable and defined Zippable.reduce_while you'd get a lot of functions for free I suspect.
Best
Adam