benji6/imlazy

`partition` is caching values.

xgbuils opened this issue · 1 comments

Hi @benji6

I was reading partition implementation and it is implemented breaking your idea about not caching values.

I propose use filter for the implementation:

module.exports.partition = curry((f, xs) => genToIter(function * () {
    yield filter(f, xs)
    yield filter(x => !f(x), xs)
}))

Cheers!

Very true! I think I was being very lazy when I wrote that code! Will push a fix :)