Skip to content

v2.0.0-beta12

Compare
Choose a tag to compare
@kevin-lee kevin-lee released this 09 Sep 12:54
· 76 commits to main since this release
2a966fa

2.0.0-beta12 - 2023-09-09

New Features

  • Add CanRestart for retrying F[A] (#566)

    trait CanRestart[F[*]] {
      def restartWhile[A](fa: F[A])(p: A => Boolean): F[A]
    
      def restartUntil[A](fa: F[A])(p: A => Boolean): F[A]
    
      def restartOnError[A](fa: F[A])(maxRetries: Long): F[A]
    
      def restartOnErrorIfTrue[A](fa: F[A])(p: Throwable => Boolean): F[A]
    }
  • Add instances of CanCatch, CanHandleError, CanRecover, FromFuture, Fx and FxCtor with Sync and Async (#568)

    So it can be done like this with the effectie.instances.ce2.f and effectie.instances.ce3.f packages.

    def foo[F[*]: Fx](n: Int): F[Int] = Fx[F].effectOf(n * 2)
    
    // Fx[F] can be satisfied with just Sync[F] like this.
    import effectie.instances.ce2.f.fx._
    def bar[F[*]: Sync](n: Int): F[Int] = foo(n)