Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump cats-effect to 3.5 #260

Merged
merged 4 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading