-
-
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
(very breaking) change in Future instances? #4617
Comments
Note the 2.11 behavior matches that of |
Right, it does 🤔. Regardless, it still looks like a very breaking change. |
looks like, but is not. See previous discussion: |
The problem is Future, and hence this function When you call test a side effect immediately starts. That is not true of the IO version. When you are working with Future you are working with an impure type and we don't limit the traverse implementation of data types to try to work that. A PR was created where a lot of energy was spent to optimize traverse implementations: #4498 -- I think it is very likely the change you are seeing is due to that. I guess what is happening is that since Future has a StackSafeMonad, it is traversing directly (which is what the standard library does), but that is triggering the side-effects in a different order. |
It depends on how you look at it (or how much code you need to fix) 😆. Thanks for chiming in, everyone! I'll close this one and will go hunting down my traverses :) |
The following code works differently with cats
2.10.0
and cats2.11.0+
With
2.10.0
it prints (https://scastie.scala-lang.org/RYQcjXExR4m0NQQBHVo25w):With
2.11.0+
(https://scastie.scala-lang.org/F21nFlI1Tl2bYm271o50ng):The text was updated successfully, but these errors were encountered: