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 1021af8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 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
2 changes: 1 addition & 1 deletion core/shared/src/main/scala/zio/ZManaged.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1170,7 +1170,7 @@ object ZManaged {

@deprecated("use succeed", "1.0.0")
final def succeedLazy[R, A](r: => A): ZManaged[R, Nothing, A] =
succeed(a)
succeed(r)

/**
* Returns a lazily constructed Managed.
Expand Down

0 comments on commit 1021af8

Please sign in to comment.