Skip to content

Commit

Permalink
Prepare for ZIO 1.0.0-RC18-2 (#158)
Browse files Browse the repository at this point in the history
* Prepare project for ZIO 1.0.0-RC18-2

* fix failNow

* Update ZIO version

Co-authored-by: Kai <[email protected]>
Co-authored-by: Kai <[email protected]>
  • Loading branch information
3 people authored Mar 12, 2020
1 parent 09563e1 commit f60e2d0
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ lazy val root = project
unusedCompileDependenciesFilter -= moduleFilter("org.scala-js", "scalajs-library")
)

val zioVersion = "1.0.0-RC18"
val zioVersion = "1.0.0-RC18-2"
lazy val interopCats = crossProject(JSPlatform, JVMPlatform)
.in(file("interop-cats"))
.enablePlugins(BuildInfoPlugin)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import scala.concurrent.ExecutionContext.global
class CatsZManagedSyntaxSpec extends Specification with AroundTimeout {

val runtime = Runtime.default
def unsafeRun[R, E, A](p: ZIO[Unit, E, A]) = runtime.unsafeRun(p)
def unsafeRun[R, E, A](p: ZIO[ZEnv, E, A]) = runtime.unsafeRun(p)

def is = s2"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import scala.concurrent.ExecutionContext.global
class ZioWithFs2Spec(implicit ee: ExecutionEnv) extends Specification with AroundTimeout {

val runtime = Runtime.default
def unsafeRun[R, E, A](p: ZIO[Unit, E, A]) = runtime.unsafeRun(p)
def unsafeRun[R, E, A](p: ZIO[ZEnv, E, A]) = runtime.unsafeRun(p)

def is =
s2"""
Expand Down
12 changes: 6 additions & 6 deletions interop-cats/shared/src/main/scala/zio/interop/cats.scala
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ abstract class CatsEffectPlatform
val console: interop.console.cats.type = interop.console.cats

trait CatsApp extends App {
implicit val runtime: Runtime[Unit] = this
implicit val runtime: Runtime[ZEnv] = this
}

object implicits {
Expand Down Expand Up @@ -211,7 +211,7 @@ private class CatsConcurrent[R] extends CatsMonadError[R, Throwable] with Concur

override final def cancelable[A](k: (Either[Throwable, A] => Unit) => effect.CancelToken[RIO[R, *]]): RIO[R, A] =
RIO.effectAsyncInterrupt[R, A] { kk =>
val token = k(kk apply _.fold(ZIO.failNow, ZIO.succeedNow))
val token = k(kk apply _.fold(ZIO.fail(_), ZIO.succeedNow))
Left(token.orDie)
}

Expand All @@ -234,10 +234,10 @@ private class CatsConcurrent[R] extends CatsMonadError[R, Throwable] with Concur
RIO.never

override final def async[A](k: (Either[Throwable, A] => Unit) => Unit): RIO[R, A] =
RIO.effectAsync(kk => k(kk apply _.fold(ZIO.failNow, ZIO.succeedNow)))
RIO.effectAsync(kk => k(kk apply _.fold(ZIO.fail(_), ZIO.succeedNow)))

override final def asyncF[A](k: (Either[Throwable, A] => Unit) => RIO[R, Unit]): RIO[R, A] =
RIO.effectAsyncM(kk => k(kk apply _.fold(ZIO.failNow, ZIO.succeedNow)).orDie)
RIO.effectAsyncM(kk => k(kk apply _.fold(ZIO.fail(_), ZIO.succeedNow)).orDie)

override final def suspend[A](thunk: => RIO[R, A]): RIO[R, A] =
RIO.effectSuspend(thunk)
Expand Down Expand Up @@ -288,7 +288,7 @@ private class CatsSemigroupKLossy[R, E] extends SemigroupK[ZIO[R, E, *]] {
override final def combineK[A](a: ZIO[R, E, A], b: ZIO[R, E, A]): ZIO[R, E, A] =
a.catchAll { e1 =>
b.catchAll { _ =>
ZIO.failNow(e1)
ZIO.fail(e1)
}
}
}
Expand All @@ -297,7 +297,7 @@ private class CatsSemigroupK[R, E: Semigroup] extends SemigroupK[ZIO[R, E, *]] {
override final def combineK[A](a: ZIO[R, E, A], b: ZIO[R, E, A]): ZIO[R, E, A] =
a.catchAll { e1 =>
b.catchAll { e2 =>
ZIO.failNow(Semigroup[E].combine(e1, e2))
ZIO.fail(Semigroup[E].combine(e1, e2))
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ trait GenIOInteropCats {
/**
* Given a generator for `E`, produces a generator for `IO[E, A]` using the `IO.fail` constructor.
*/
def genSyncFailure[E: Arbitrary, A]: Gen[IO[E, A]] = Arbitrary.arbitrary[E].map(IO.failNow[E])
def genSyncFailure[E: Arbitrary, A]: Gen[IO[E, A]] = Arbitrary.arbitrary[E].map(IO.fail[E](_))

/**
* Given a generator for `E`, produces a generator for `IO[E, A]` using the `IO.async` constructor.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ trait GenStreamInteropCats {
/**
* Given a generator for `E`, produces a generator for `Stream[E, A]` using the `Stream.fail` constructor.
*/
def genFailure[E: Arbitrary, A]: Gen[Stream[E, A]] = Arbitrary.arbitrary[E].map(Stream.failNow[E])
def genFailure[E: Arbitrary, A]: Gen[Stream[E, A]] = Arbitrary.arbitrary[E].map(Stream.fail[E](_))

/**
* Randomly uses either `genSuccess` or `genFailure` with equal probability.
Expand Down

0 comments on commit f60e2d0

Please sign in to comment.