diff --git a/zio-interop-cats/shared/src/main/scala/zio/interop/cats.scala b/zio-interop-cats/shared/src/main/scala/zio/interop/cats.scala index 472c6e21..9897ba8e 100644 --- a/zio-interop-cats/shared/src/main/scala/zio/interop/cats.scala +++ b/zio-interop-cats/shared/src/main/scala/zio/interop/cats.scala @@ -482,7 +482,7 @@ private final class ZioRef[R, E, A](ref: ZRef[A]) extends effect.Ref[ZIO[R, E, _ def setter(a: A): F[Boolean] = ZIO.suspendSucceed { if (called.getAndSet(true)) { - ZIO.succeedNow(false) + ZIO.succeed(false) } else { ref.modify { updated => if (current == updated) (true, a) @@ -665,7 +665,7 @@ private abstract class ZioMonadError[R, E, E1] extends MonadError[ZIO[R, E, _], type F[A] = ZIO[R, E, A] override final def pure[A](a: A): F[A] = - ZIO.succeedNow(a) + ZIO.succeed(a) override final def map[A, B](fa: F[A])(f: A => B): F[B] = { implicit def trace: Trace = InteropTracer.newTrace(f) @@ -710,7 +710,7 @@ private abstract class ZioMonadError[R, E, E1] extends MonadError[ZIO[R, E, _], override final def tailRecM[A, B](a: A)(f: A => F[Either[A, B]]): F[B] = { def loop(a: A): F[B] = f(a).flatMap { case Left(a) => loop(a) - case Right(b) => ZIO.succeedNow(b) + case Right(b) => ZIO.succeed(b) } ZIO.suspendSucceed(loop(a)) @@ -783,7 +783,7 @@ private trait ZioMonadErrorExitThrowable[R] protected final def toOutcomeOtherFiber[A](interruptedHandle: zio.Ref[Boolean])( exit: Exit[Throwable, A] ): UIO[Outcome[F, Throwable, A]] = - interruptedHandle.get.map(toOutcomeThrowableOtherFiber(_)(ZIO.succeedNow, exit)) + interruptedHandle.get.map(toOutcomeThrowableOtherFiber(_)(ZIO.succeed(_), exit)) } private trait ZioMonadErrorExitCause[R, E] extends ZioMonadErrorExit[R, E, Cause[E]] with ZioMonadErrorCause[R, E] { @@ -794,7 +794,7 @@ private trait ZioMonadErrorExitCause[R, E] extends ZioMonadErrorExit[R, E, Cause protected final def toOutcomeOtherFiber[A](interruptedHandle: zio.Ref[Boolean])( exit: Exit[E, A] ): UIO[Outcome[F, Cause[E], A]] = - interruptedHandle.get.map(toOutcomeCauseOtherFiber(_)(ZIO.succeedNow, exit)) + interruptedHandle.get.map(toOutcomeCauseOtherFiber(_)(ZIO.succeed(_), exit)) } private class ZioSemigroupK[R, E] extends SemigroupK[ZIO[R, E, _]] { @@ -851,7 +851,7 @@ private class ZioParApplicative[R, E] extends CommutativeApplicative[ParallelF[Z type F[A] = ParallelF[G, A] final override def pure[A](x: A): F[A] = - ParallelF[G, A](ZIO.succeedNow(x)) + ParallelF[G, A](ZIO.succeed(x)) final override def map2[A, B, Z](fa: F[A], fb: F[B])(f: (A, B) => Z): F[Z] = { implicit def trace: Trace = InteropTracer.newTrace(f) @@ -890,7 +890,7 @@ private class ZioSemigroup[R, E, A](implicit semigroup: Semigroup[A]) extends Se private class ZioMonoid[R, E, A](implicit monoid: Monoid[A]) extends ZioSemigroup[R, E, A] with Monoid[ZIO[R, E, A]] { override final val empty: T = - ZIO.succeedNow(monoid.empty) + ZIO.succeed(monoid.empty) } private class ZioParSemigroup[R, E, A](implicit semigroup: CommutativeSemigroup[A]) @@ -910,7 +910,7 @@ private class ZioParMonoid[R, E, A](implicit monoid: CommutativeMonoid[A]) with CommutativeMonoid[ParallelF[ZIO[R, E, _], A]] { override final val empty: T = - ParallelF[ZIO[R, E, _], A](ZIO.succeedNow(monoid.empty)) + ParallelF[ZIO[R, E, _], A](ZIO.succeed(monoid.empty)) } private class ZioLiftIO[R](implicit runtime: IORuntime) extends LiftIO[RIO[R, _]] { diff --git a/zio-interop-cats/shared/src/main/scala/zio/interop/catszmanaged.scala b/zio-interop-cats/shared/src/main/scala/zio/interop/catszmanaged.scala index fef9a100..7388b0ac 100644 --- a/zio-interop-cats/shared/src/main/scala/zio/interop/catszmanaged.scala +++ b/zio-interop-cats/shared/src/main/scala/zio/interop/catszmanaged.scala @@ -84,7 +84,7 @@ final class ZIOResourceSyntax[R, E <: Throwable, A](private val resource: Resour eval.fa case pure: Resource.Pure[F, B] => - ZIO.succeedNow(pure.a) + ZIO.succeed(pure.a) } go(resource) @@ -115,7 +115,7 @@ final class ScopedSyntax(private val self: Resource.type) extends AnyVal { Resource.suspend( scope.extend[R] { zio.map { case a => - Resource.applyCase[F, A](ZIO.succeedNow((a, _ => ZIO.unit))) + Resource.applyCase[F, A](ZIO.succeed((a, _ => ZIO.unit))) } } ) @@ -186,7 +186,7 @@ private class ZManagedMonadError[R, E] extends MonadError[ZManaged[R, E, _], E] type F[A] = ZManaged[R, E, A] override final def pure[A](a: A): F[A] = - ZManaged.succeedNow(a) + ZManaged.succeed(a) override final def map[A, B](fa: F[A])(f: A => B): F[B] = fa.map(f)(InteropTracer.newTrace(f)) @@ -235,7 +235,7 @@ private class ZManagedMonadError[R, E] extends MonadError[ZManaged[R, E, _], E] ZManaged.suspend(f(a)).flatMap { case Left(a) => tailRecM(a)(f) - case Right(b) => ZManaged.succeedNow(b) + case Right(b) => ZManaged.succeed(b) } } } @@ -252,7 +252,7 @@ private class ZManagedMonoid[R, E, A](implicit monoid: Monoid[A]) with Monoid[ZManaged[R, E, A]] { override final val empty: T = - ZManaged.succeedNow(monoid.empty) + ZManaged.succeed(monoid.empty) } private class ZManagedSemigroupK[R, E] extends SemigroupK[ZManaged[R, E, _]] { @@ -292,7 +292,7 @@ private class ZManagedParMonoid[R, E, A](implicit monoid: CommutativeMonoid[A]) with CommutativeMonoid[ParallelF[ZManaged[R, E, _], A]] { override final val empty: T = - ParallelF[ZManaged[R, E, _], A](ZManaged.succeedNow(monoid.empty)) + ParallelF[ZManaged[R, E, _], A](ZManaged.succeed(monoid.empty)) } private class ZManagedBifunctor[R] extends Bifunctor[ZManaged[R, _, _]] { @@ -325,7 +325,7 @@ private class ZManagedParApplicative[R, E] extends CommutativeApplicative[Parall type F[A] = ParallelF[G, A] final override def pure[A](x: A): F[A] = - ParallelF[G, A](ZManaged.succeedNow(x)) + ParallelF[G, A](ZManaged.succeed(x)) final override def map2[A, B, Z](fa: F[A], fb: F[B])(f: (A, B) => Z): F[Z] = { implicit val tracer: Trace = InteropTracer.newTrace(f) diff --git a/zio-interop-cats/shared/src/main/scala/zio/interop/package.scala b/zio-interop-cats/shared/src/main/scala/zio/interop/package.scala index dfb09374..046bfa0d 100644 --- a/zio-interop-cats/shared/src/main/scala/zio/interop/package.scala +++ b/zio-interop-cats/shared/src/main/scala/zio/interop/package.scala @@ -122,13 +122,13 @@ package object interop { convertDie: Cause[Nothing] => E1 ): UIO[Outcome[ZIO[R, E, _], E1, A]] = exit match { case Exit.Success(value) => - ZIO.succeedNow(Outcome.Succeeded(ZIO.succeedNow(value))) + ZIO.succeed(Outcome.Succeeded(ZIO.succeed(value))) case Exit.Failure(cause) => lazy val nonCanceledOutcome: UIO[Outcome[ZIO[R, E, _], E1, A]] = cause.failureOrCause match { case Left(error) => - ZIO.succeedNow(Outcome.Errored(convertFail(error, cause))) + ZIO.succeed(Outcome.Errored(convertFail(error, cause))) case Right(cause) => - ZIO.succeedNow(Outcome.Errored(convertDie(cause))) + ZIO.succeed(Outcome.Errored(convertDie(cause))) } // ZIO 2, unlike ZIO 1, _does not_ guarantee that the presence of a typed failure // means we're NOT interrupting, so we have to check for interruption to matter what @@ -143,7 +143,7 @@ package object interop { ) { ZIO.descriptorWith { descriptor => if (descriptor.interrupters.nonEmpty) - ZIO.succeedNow(Outcome.Canceled()) + ZIO.succeed(Outcome.Canceled()) else { nonCanceledOutcome } @@ -156,15 +156,15 @@ package object interop { private[interop] def toExitCaseThisFiber(exit: Exit[Any, Any])(implicit trace: Trace): UIO[Resource.ExitCase] = exit match { case Exit.Success(_) => - ZIO.succeedNow(Resource.ExitCase.Succeeded) + ZIO.succeed(Resource.ExitCase.Succeeded) case Exit.Failure(cause) => lazy val nonCanceledOutcome: UIO[Resource.ExitCase] = cause.failureOrCause match { case Left(error: Throwable) => - ZIO.succeedNow(Resource.ExitCase.Errored(error)) + ZIO.succeed(Resource.ExitCase.Errored(error)) case Left(_) => - ZIO.succeedNow(Resource.ExitCase.Errored(FiberFailure(cause))) + ZIO.succeed(Resource.ExitCase.Errored(FiberFailure(cause))) case Right(cause) => - ZIO.succeedNow(Resource.ExitCase.Errored(dieCauseToThrowable(cause))) + ZIO.succeed(Resource.ExitCase.Errored(dieCauseToThrowable(cause))) } // ZIO 2, unlike ZIO 1, _does not_ guarantee that the presence of a typed failure // means we're NOT interrupting, so we have to check for interruption to matter what @@ -179,7 +179,7 @@ package object interop { ) { ZIO.descriptorWith { descriptor => if (descriptor.interrupters.nonEmpty) { - ZIO.succeedNow(Resource.ExitCase.Canceled) + ZIO.succeed(Resource.ExitCase.Canceled) } else nonCanceledOutcome }