Skip to content

Commit

Permalink
Update core-tests, zio to 1.0.0-RC12 (#50)
Browse files Browse the repository at this point in the history
* Update core-tests, zio to 1.0.0-RC12

* Fix deprecated warnings

* Fix deprecated warnings

* Use ZIO 1.0.0-RC12-1

* Use ZIO 1.0.0-RC12-1

* Remove dependency to ZIO core tests

* Deprecate methods and use suspend in catszmanaged
  • Loading branch information
scala-steward authored and ghostdogpr committed Sep 3, 2019
1 parent a89b9c1 commit d4ce92b
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 10 deletions.
3 changes: 1 addition & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,10 @@ lazy val interopCats = crossProject(JSPlatform, JVMPlatform)
.settings(buildInfoSettings)
.settings(
libraryDependencies ++= Seq(
"dev.zio" %%% "zio" % "1.0.0-RC11-1",
"dev.zio" %%% "zio" % "1.0.0-RC12-1",
"org.typelevel" %%% "cats-effect" % "2.0.0-RC2" % Optional,
"org.typelevel" %%% "cats-mtl-core" % "0.6.0" % Optional,
"co.fs2" %%% "fs2-core" % "1.1.0-M1" % Test,
"dev.zio" %%% "core-tests" % "1.0.0-RC11-1" % Test classifier "tests",
"org.specs2" %%% "specs2-core" % "4.7.0" % Test,
"org.specs2" %%% "specs2-scalacheck" % "4.7.0" % Test,
"org.specs2" %%% "specs2-matcher-extra" % "4.7.0" % Test,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ class CatsZManagedSyntaxSpec extends Specification with AroundTimeout with Defau
Concurrent
.timeout(resource.use(_ => CIO.unit), FiniteDuration(0, TimeUnit.SECONDS))
.unsafeRunSync()
}.const(false) orElse UIO(true)
}.as(false) orElse UIO(true)
_ <- latch.succeed(())
} yield res must_=== true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -420,8 +420,9 @@ object Schedule {
/**
* @see zio.ZSchedule.succeedLazy
*/
@deprecated("use succeed", "2.0.0.0")
final def succeedLazy[F[+_], A](a: => A): Schedule[F, Any, A] =
new Schedule(ZSchedule.succeedLazy(a))
new Schedule(ZSchedule.succeed(a))

/**
* @see zio.ZSchedule.fromFunction
Expand Down
6 changes: 3 additions & 3 deletions interop-cats/shared/src/main/scala/zio/interop/cats.scala
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ private class CatsConcurrentEffect[R](rts: Runtime[R])
f.await
.flatMap(exit => IO.effect(cb(exit.toEither).unsafeRunAsync(_ => ())))
.fork
.const(f.interrupt.unit)
.as(f.interrupt.unit)
}
}
}
Expand Down Expand Up @@ -164,9 +164,9 @@ private class CatsConcurrent[R] extends CatsEffect[R] with Concurrent[RIO[R, ?]]
override final def race[A, B](fa: RIO[R, A], fb: RIO[R, B]): RIO[R, Either[A, B]] =
racePair(fa, fb).flatMap {
case Left((a, fiberB)) =>
fiberB.cancel.const(Left(a))
fiberB.cancel.as(Left(a))
case Right((fiberA, b)) =>
fiberA.cancel.const(Right(b))
fiberA.cancel.as(Right(b))
}

override final def start[A](fa: RIO[R, A]): RIO[R, effect.Fiber[RIO[R, ?], A]] =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ private class CatsZManagedMonad[R, E] extends Monad[ZManaged[R, E, ?]] {
override def flatMap[A, B](fa: ZManaged[R, E, A])(f: A => ZManaged[R, E, B]): ZManaged[R, E, B] = fa.flatMap(f)

override def tailRecM[A, B](a: A)(f: A => ZManaged[R, E, Either[A, B]]): ZManaged[R, E, B] =
ZManaged.succeedLazy(f(a)).flatMap(identity).flatMap {
ZManaged.suspend(f(a)).flatMap {
case Left(nextA) => tailRecM(nextA)(f)
case Right(b) => ZManaged.succeed(b)
}
Expand Down
5 changes: 3 additions & 2 deletions interop-cats/shared/src/main/scala/zio/interop/stm/STM.scala
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ object STM {
new STM(ZSTM.collectAll(i.map(_.underlying)))

final def die[F[+_]](t: Throwable): STM[F, Nothing] =
succeedLazy(throw t)
succeed(throw t)

final def dieMessage[F[+_]](m: String): STM[F, Nothing] =
die(new RuntimeException(m))
Expand All @@ -219,8 +219,9 @@ object STM {

final def succeed[F[+_], A](a: A): STM[F, A] = new STM(ZSTM.succeed(a))

@deprecated("use succeed", "2.0.0.0")
final def succeedLazy[F[+_], A](a: => A): STM[F, A] =
new STM(ZSTM.succeedLazy(a))
new STM(ZSTM.succeed(a))

final def unit[F[+_]]: STM[F, Unit] = succeed(())
}

0 comments on commit d4ce92b

Please sign in to comment.