emmanueltouzery / prelude-ts

Functional programming, immutable collections and FP constructs for typescript and javascript
ISC License
377 stars 21 forks source link

Function returned from Either::liftApAcc closes over leftErrs from the outer scope #64

Open flakey-bit opened 2 years ago

flakey-bit commented 2 years ago

Firstly, thanks for the great library 🙂

It appears that the function returned from Either::liftApAcc closes over leftErrs from the outer scope.

That effectively means the function returned from Either::liftApAcc is stateful and can't be used more than once.

NB: I noticed while applying your suggestion from https://github.com/emmanueltouzery/prelude-ts/issues/61.