Skip to content

Commit

Permalink
Merge pull request #2733 from TimWSpence/doc-fix
Browse files Browse the repository at this point in the history
Correct `IO#racePair` docs
  • Loading branch information
armanbilge committed Jan 10, 2022
2 parents 392f43e + 7fca425 commit e284f2c
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 @@ -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

0 comments on commit e284f2c

Please sign in to comment.