Skip to content

Commit

Permalink
Correct IO#racePair docs
Browse files Browse the repository at this point in the history
  • Loading branch information
TimWSpence committed Jan 7, 2022
1 parent 614e989 commit 7fa0fa4
Showing 1 changed file with 2 additions and 5 deletions.
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 @@ -1257,9 +1257,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 @@ -1269,9 +1266,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

0 comments on commit 7fa0fa4

Please sign in to comment.