Reducers#1102
Conversation
Remove Enum.equal? Remove File.iterator/2 and File.biniterator/2
There was a problem hiding this comment.
Since both this clause and the next clause are basically doing a reduction, I think we can get rid of this one altogether.
There was a problem hiding this comment.
This one is wrong. Basically, after the first time the function returns false, we get the rest of the list. It should be something like:
fn
(entry, []) -> if fun.(entry), do: [], else: [entry]
(entry, acc) -> [entry|acc]
endWe are basically using the accumulator to check if something was added so far (or not).
There was a problem hiding this comment.
Good catch, will add tests for it aswell.
|
❤️ 💚 💙 💛 💜 |
There was a problem hiding this comment.
Replace nil by true here and in the next line, and we can get rid of the true return value before catch.
|
I have seen that you kept the specific clauses for lists in many functions but we can get rid of many of them. We definitely should remove: We should also rewrite We should consider removing the specific lists clauses for |
|
@josevalim New commit with discussed changes. |
|
I think I prefer |
|
I'd call it |
It is simply something that is reducible with the |
|
I'd like to see how the docs will describe this new stuff before deciding on the name. |
|
Added documentation |
|
It would be nice to have some historical background of the reasons for migrating from iterator to reduce. Not necessarily in the docs, it could be mentioned in a commit message. Since the main point of the protocol is reducing a collection, I'd call it
|
No description provided.