Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
ioleo committed Aug 10, 2019
1 parent 0907a02 commit 8c696dd
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions core/shared/src/main/scala/zio/ZIO.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1899,12 +1899,11 @@ private[zio] trait ZIOFunctions extends Serializable {
* composite fiber that produces a list of their results, in order.
*/
final def forkAll[R, E, A](as: Iterable[ZIO[R, E, A]]): ZIO[R, Nothing, Fiber[E, List[A]]] =
as.foldRight[ZIO[R, Nothing, Fiber[E, List[A]]]](succeed(Fiber.succeed[E, List[A]](List()))) {
(aIO, asFiberIO) =>
asFiberIO.zip(aIO.fork).map {
case (asFiber, aFiber) =>
asFiber.zipWith(aFiber)((as, a) => a :: as)
}
as.foldRight[ZIO[R, Nothing, Fiber[E, List[A]]]](succeed(Fiber.succeed[E, List[A]](List()))) { (aIO, asFiberIO) =>
asFiberIO.zip(aIO.fork).map {
case (asFiber, aFiber) =>
asFiber.zipWith(aFiber)((as, a) => a :: as)
}
}

/**
Expand Down

0 comments on commit 8c696dd

Please sign in to comment.