Skip to content

Override map2Eval in FlatMap#3951

Merged
djspiewak merged 1 commit intotypelevel:mainfrom
vasilmkd:map2eval
Jul 26, 2021
Merged

Override map2Eval in FlatMap#3951
djspiewak merged 1 commit intotypelevel:mainfrom
vasilmkd:map2eval

Conversation

@vasilmkd
Copy link
Copy Markdown
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
Copy Markdown
Contributor

xuwei-k commented Dec 15, 2021

@johnynek
Copy link
Copy Markdown
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