elixir-lang/elixir — pull request #1922 by josevalim (2013-12-11 14:12:39+00:00)
Title: Migrate Enumerable to use an iteratees based solution

This pull request migrates the Enumerable protocol to use a solution based on iteratees. This allow us to halt enumeration (cleaning up the implementation of functions like `take/2` and `drop/2`) and also adds the possibility of interleaving enumerables via suspend. To show case the new functionalities we got, this pull request considerably extends the `Stream` API, by adding functions like `zip/2`, `chunks/4` and more. More info can be found in the updated documentation for Enumerable. @pmintem is also working on a blog post that explains the underlying mechanisms quite well.

On the negative side, this pull request does backwards incompatible changes on how the Enumerable protocol works. For this reason, the next Elixir release will be tagged 0.12.0 (to be released this weekend).

Huge thanks to @jessitron for pairing with me on the initial implementation of iteratees. Feedback is welcome!

/cc @ericmj @pmintem @devinus @meh