elixir-lang/elixir — pull request #1878 by pminten (2013-11-14 13:09:46+00:00)
Title: Enum.{map_,}intersperse, change to join{_map,}

Add an intersperse function and make join work with it (and with
iolist_to_binary). In theory that should be a minor performance improvement.

Not quite sure if the new join function is that much better in practice, it very much depends on how well iolist_to_binary performs, but that's a bif so it should be fairly fast.

Intersperse is different than join because join would (if the implementation actually obeyed the doc instead of failing when the joiner is a list) result in `[1, 0, 0, 2, 0, 0, 3]` for `Enum.join([1,2,3],[0,0])` whereas `Enum.intersperse([1,2,3],[0,0])` gives `[1, [0, 0], 2, [0, 0], 3]`.