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

Correct IO#racePair docs #2733

Merged
merged 1 commit into from
Jan 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions core/shared/src/main/scala/cats/effect/IO.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1245,9 +1245,6 @@ object IO extends IOCompanionPlatform with IOLowPriorityImplicits {
* Run two IO tasks concurrently, and returns a pair containing both the winner's successful
* value and the loser represented as a still-unfinished task.
*
* If the first task completes in error, then the result will complete in error, the other
* task being canceled.
*
* On usage the user has the option of canceling the losing task, this being equivalent with
* plain [[race]]:
*
Expand All @@ -1257,9 +1254,9 @@ object IO extends IOCompanionPlatform with IOLowPriorityImplicits {
*
* IO.racePair(ioA, ioB).flatMap {
* case Left((a, fiberB)) =>
* fiberB.cancel.map(_ => a)
* fiberB.cancel.as(a)
* case Right((fiberA, b)) =>
* fiberA.cancel.map(_ => b)
* fiberA.cancel.as(b)
* }
* }}}
*
Expand Down