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

feat: migrate to scala 3 v2 #538

Merged
merged 20 commits into from
Dec 3, 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
3 changes: 0 additions & 3 deletions modules/core/shared/src/main/scala/retry/implicits.scala

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,7 @@ package retry.syntax
import retry.{RetryDetails, RetryPolicy}
import cats.effect.Temporal

trait RetrySyntax:
implicit final def retrySyntaxBase[M[_], A](
action: => M[A]
): RetryingOps[M, A] =
new RetryingOps[M, A](action)

implicit final def retrySyntaxError[M[_], A](
action: => M[A]
): RetryingErrorOps[M, A] =
new RetryingErrorOps[M, A](action)

final class RetryingOps[M[_], A](action: => M[A]):
extension [M[_], A](action: => M[A])

def retryingOnFailures[E](
wasSuccessful: A => M[Boolean],
Expand All @@ -27,7 +16,6 @@ final class RetryingOps[M[_], A](action: => M[A]):
onFailure = onFailure
)(action)

final class RetryingErrorOps[M[_], A](action: => M[A]):
def retryingOnAllErrors(
policy: RetryPolicy[M],
onError: (Throwable, RetryDetails) => M[Unit]
Expand Down Expand Up @@ -75,4 +63,4 @@ final class RetryingErrorOps[M[_], A](action: => M[A]):
onFailure = onFailure,
onError = onError
)(action)
end RetryingErrorOps
end extension
3 changes: 0 additions & 3 deletions modules/core/shared/src/main/scala/retry/syntax/all.scala

This file was deleted.

4 changes: 0 additions & 4 deletions modules/core/shared/src/main/scala/retry/syntax/package.scala

This file was deleted.

2 changes: 1 addition & 1 deletion modules/core/shared/src/test/scala/retry/SyntaxSuite.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package retry

import retry.syntax.all.*
import retry.syntax.*

import scala.concurrent.duration.*
import munit.CatsEffectSuite
Expand Down
2 changes: 1 addition & 1 deletion modules/docs/src/main/mdoc/docs/combinators.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ Instead of calling the combinators and passing in your action, you can call them
as extension methods.

```scala mdoc:nest:silent
import retry.syntax.all._
import retry.syntax.*

// To retry until you get a value you like
IO(loadedDie.roll()).retryingOnFailures(
Expand Down
4 changes: 2 additions & 2 deletions modules/docs/src/main/mdoc/docs/mtl-combinators.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ import cats.effect.{Async, IO}
import cats.syntax.functor._
import cats.syntax.flatMap._
import cats.mtl.Handle
import retry.mtl.syntax.all._
import retry.syntax.all._
import retry.mtl.syntax.*
import retry.syntax.*
import scala.concurrent.duration._
import cats.effect.unsafe.implicits.global

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,7 @@ import cats.effect.Temporal
import cats.mtl.Handle
import retry.{RetryDetails, RetryPolicy}

trait RetrySyntax:
implicit final def retrySyntaxMtlError[M[_], A](
action: => M[A]
): RetryingMtlErrorOps[M, A] =
new RetryingMtlErrorOps[M, A](action)

final class RetryingMtlErrorOps[M[_], A](action: => M[A]):

extension [M[_], A](action: M[A])
def retryingOnAllMtlErrors[E](
policy: RetryPolicy[M],
onError: (E, RetryDetails) => M[Unit]
Expand Down
3 changes: 0 additions & 3 deletions modules/mtl/shared/src/main/scala/retry/mtl/syntax/all.scala

This file was deleted.

This file was deleted.

4 changes: 2 additions & 2 deletions modules/mtl/shared/src/test/scala/retry/mtl/SyntaxSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package retry.mtl

import cats.data.EitherT
import munit.CatsEffectSuite
import retry.syntax.all.*
import retry.mtl.syntax.all.*
import retry.syntax.*
import retry.mtl.syntax.*
import retry.{RetryDetails, RetryPolicies, RetryPolicy}

import scala.concurrent.duration.*
Expand Down