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

Use IO.unit in Async[IO].unit #4162

Merged
merged 1 commit into from
Oct 31, 2024
Merged

Conversation

iRevive
Copy link
Contributor

@iRevive iRevive commented Oct 31, 2024

The default implementation from Applicative is def unit: F[Unit] = pure(()).

Currently, Async[IO].unit.replicate(100) would result in 100 IO.Pure(()). But with override, we will reuse the same single unit instance.

@iRevive iRevive changed the title IO: override def unit in Async[IO] Override def unit in Async[IO] Oct 31, 2024
@iRevive iRevive changed the title Override def unit in Async[IO] Use IO.unit in Async[IO].unit Oct 31, 2024
@djspiewak djspiewak merged commit 211e8d5 into typelevel:series/3.x Oct 31, 2024
28 of 33 checks passed
@iRevive iRevive deleted the io-async-unit branch October 31, 2024 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants