elixir-lang/elixir — pull request #1080 by meh (2013-05-16 14:07:49+00:00)
Title: Simplify Enum.Iterator, second round

I feel this is very important, so I made what @yrashk proposed, it works although the documentation there would need some love, but this is just a draft to have an actual proposal with code backing it up, so the same goes for missing tests.

So yeah, I want this, anything against it that isn't code _complexity_ (it's less than 100 lines which would make implementing iterators way easier)?

Here's a stupid example:

```elixir
defrecord LOL, [] do

end

defimpl Enum.Iterator, for: LOL do
use Enum.Iterator.Defaults

def iterator(_) do
{ fn _ -> :stop end, { 1, nil } }
end
end

IO.inspect Enum.count(LOL[])
IO.inspect Enum.member?(LOL[], 1)
IO.inspect Enum.member?(LOL[], 2)
IO.inspect Enum.empty?(LOL[])
```