-
-
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
Changes in Future traverse behavior between 2.6 and 2.7 #4176
Comments
I think you may have seen a discussion on discord but there is no contract in traverse of what order the functions are applied in. So, from a functional programming perspective, the problem is having an effectful As noted on discord, a workaround is change Side note: I have been a proponent of including this instance because it is lawful when used with lawful functions and values. Others argue that it is too dangerous since it encourages you to write code like this which leads to bugs. I think now that alleycats has been merged with this repo and it easier to edit all the code in one PR it would probably be better to move this instance to alleycats but I am concerned that now the breakage would cause problems for users and one of the reasons people trust cats to be a dependency is that we have been very careful to avoid breakages. |
Just for the record, if you have this problem another way to fix it is using |
Unfortunately this is a "wontfix", since Cats does not make any guarantees about this behavior. Improving the documentation on this is tracked in: Meanwhile, hopefully the workarounds above are helpful to those in a pinch. |
Partially fixes the race condition with slow sources. Since cats 2.7, `xs.traverse(futureFunction)` runs the futures sequentially instead of in parallel. typelevel/cats#4176 This caused the relay sync to last way too long.
Two different reports in discord about this:
I am creating this issue to have better discoverability of this issue and discuss workarounds, because reverting to the old behavior seems not to not be a possibility...
The text was updated successfully, but these errors were encountered: