-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make traverse lazy #513
Comments
Yes, I believe this is the case, and I would vote 👍 for this happening. The question is where exactly it would need to go, since |
I think that now that |
I'm working on this. |
I have a good start on this in a local branch, but this week got busy. I'm hoping to submit a PR next week. |
Fixes typelevel#513. I think this should solve the majority of use-cases for lazy traversal. One thing I noticed is that both `reduceRightToOption` and `traverse1_` (which uses the former) seem to be impossible to implement lazily such that they allow for short-circuiting. At least I couldn't figure out a way. I left a note in the `traverse1_` scaladoc, but in practice I don't anticipate this being a problem, because at the cost of just having an `Applicative` instance as opposed to `Apply`, you can use `traverse_` which is sufficiently lazy.
Fixes typelevel#513. I think this should solve the majority of use-cases for lazy traversal. One thing I noticed is that both `reduceRightToOption` and `traverse1_` (which uses the former) seem to be impossible to implement lazily such that they allow for short-circuiting. At least I couldn't figure out a way. I left a note in the `traverse1_` scaladoc, but in practice I don't anticipate this being a problem, because at the cost of just having an `Applicative` instance as opposed to `Apply`, you can use `traverse_` which is sufficiently lazy.
Fixes typelevel#513. I think this should solve the majority of use-cases for lazy traversal. One thing I noticed is that both `reduceRightToOption` and `traverse1_` (which uses the former) seem to be impossible to implement lazily such that they allow for short-circuiting. At least I couldn't figure out a way. I left a note in the `traverse1_` scaladoc, but in practice I don't anticipate this being a problem, because at the cost of just having an `Applicative` instance as opposed to `Apply`, you can use `traverse_` which is sufficiently lazy.
I believe we can make
traverse
lazy by using thunk orEval
inApplicative.map2
(please correct me if I am wrong)The text was updated successfully, but these errors were encountered: