Skip to content

Commit

Permalink
feat: migrate to scala 3 v2 (#538)
Browse files Browse the repository at this point in the history
This PR finish the scala 3 changes on
#532

---------

Co-authored-by: Cristian Cantarero <[email protected]>
Co-authored-by: alejandrobudy <[email protected]>
Co-authored-by: Alejandro <[email protected]>
  • Loading branch information
4 people authored Dec 3, 2024
1 parent 7b14ac3 commit ab0134d
Show file tree
Hide file tree
Showing 11 changed files with 9 additions and 45 deletions.
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

0 comments on commit ab0134d

Please sign in to comment.