-
-
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
Stack-safety issues in Kleisli
instances
#3947
Comments
I think an issue there is a deep, cats3-level issue that I could fix this issue with this diff:
but requiring a Note, we did something pretty unprincipled before: #2185 to address a related issue. If instead of doing the reflection hack there, we had used This is related to how We could add a higher priority implicit to provide the Apply/Applicative/Monad/... etc I wrote above if a Defer is available for F, but that does complicate the implicit search for Kleisi and it is already quite complex. Also, we need to work to remove all internal calls to |
basically, look at all the internal calls to |
Source-breaking for sure, but theoretically we could do this in a binary-compatible way? e.g. taking your idea
But instead of making it a higher-priority implicit, making the old way no longer an implicit. |
Yeah, I guess that's true. But, also note how many internal methods to Honestly, I wonder if a whole new implementation is worth it. |
I've updated the PR. One work around is to make collections have safe |
see #3962 for some related work. |
Repro 1:
traverse_
relies onList
'sfoldRight
andKleisli
'smap2Eval
under the hood, which in turn relies onF.map2Eval
Repro 2 (involves Cats Effect):
Thus, using
Kleisli[IO, R, A]
may result in SO at runtime if operations involvingIO.Par
are used, e.g.parTraverse_
.The text was updated successfully, but these errors were encountered: