Skip to content

Commit

Permalink
bump cats-effect to 3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Denys Fakhritdinov committed Jan 29, 2024
1 parent 462fc38 commit f8150d9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,14 @@ object FromFuture {
for {
future <- Sync[F].delay(future)
result <- future.value.fold {
Async[F].async_[A] { callback =>
future.onComplete { a =>
callback(a.toEither)
Async[F].async[A] { callback =>
Async[F].delay {
future.onComplete { a =>
callback(a.toEither)
}
// immitates semantic _before_ v3.5
// https://github.com/typelevel/cats-effect/releases/tag/v3.5.0
Async[F].unit.some
}
}
} {
Expand All @@ -62,10 +67,15 @@ object FromFuture {
executor <- Async[F].executionContext
future <- Sync[F].delay(future)
result <- future.value.fold {
Async[F].async_[A] { callback =>
future.onComplete { a =>
callback(a.toEither)
}(executor)
Async[F].async[A] { callback =>
Async[F].delay {
future.onComplete { a =>
callback(a.toEither)
}(executor)
// immitates semantic _before_ v3.5
// https://github.com/typelevel/cats-effect/releases/tag/v3.5.0
Async[F].unit.some
}
}
} {
case Success(a) => Async[F].pure(a)
Expand All @@ -79,8 +89,8 @@ object FromFuture {
def functionK[F[_]: FromFuture]: FunctionK[Future, F] =
new FunctionK[Future, F] {

def apply[A](fa: Future[A]) = FromFuture.summon[F].apply(fa)
}
def apply[A](fa: Future[A]) = FromFuture.summon[F].apply(fa)
}

implicit val futureFromFuture: FromFuture[Future] = new FromFuture[Future] {
def apply[A](future: => Future[A]) = future
Expand Down
4 changes: 2 additions & 2 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ object Dependencies {
}

object Cats {
private val version = "2.9.0"
private val version = "2.10.0"
val core = "org.typelevel" %% "cats-core" % version
val kernel = "org.typelevel" %% "cats-kernel" % version
val macros = "org.typelevel" %% "cats-macros" % version

private val effectVersion = "3.4.8"
private val effectVersion = "3.5.3"
val effect = "org.typelevel" %% "cats-effect" % effectVersion
val effectLaws = "org.typelevel" %% "cats-effect-laws" % effectVersion
val effectTestkit = "org.typelevel" %% "cats-effect-testkit" % effectVersion
Expand Down

0 comments on commit f8150d9

Please sign in to comment.