Skip to content
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

Override map2Eval in FlatMap #3951

Merged
merged 1 commit into from
Jul 26, 2021
Merged

Override map2Eval in FlatMap #3951

merged 1 commit into from
Jul 26, 2021

Conversation

vasilmkd
Copy link
Member

We noticed that if not explicitly overridden to support lazy evaluation of the right argument, map2Eval can cause StackOverflowErrors for effect types.

Relevant Cats Effect issue.
typelevel/cats-effect#2095

@djspiewak djspiewak merged commit 6370adb into typelevel:main Jul 26, 2021
@vasilmkd vasilmkd deleted the map2eval branch July 28, 2021 10:25
@xuwei-k
Copy link
Contributor

xuwei-k commented Dec 15, 2021

@johnynek
Copy link
Contributor

@xuwei-k I'm confused how your instance can be lawful and impacted by this change.

That said, leaving map2/map2Eval to be the default in FlatMap is probably a deoptimization for many cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants