v2.0.0-beta13
2.0.0-beta13 - 2023-10-01
Changes
CanHandleError[Future]
andCanRecover[Future]
should useFuture
'srecover
andrecoverWith
. (#584)CanHandleError[Try].handleNonFatal
andCanRecover[Try].recoverFromNonFatal
should useTry
'srecover
(#586)
New Feature
-
rethrowIfLeft
andrethrowTIfLeft
syntax
forF[Either[A, B]]
andEitherT[F, A, B]
(#588)val fa: IO[Either[Throwable, Int]] = pureOf[IO](Right(1)) fa.rethrowIfLeft // IO[Int] = IO(1)
val fa: IO[Either[Throwable, Int]] = pureOf[IO](Left(new RuntimeException("Error"))) fa.rethrowIfLeft // IO[Int] = RaiseError(RuntimeException("ERROR"))
val fa: EitherT[IO, Throwable, Int] = pureOf[IO](Right(1)).eitherT fa.rethrowTIfLeft // IO[Int] = IO(1)
val fa: EitherT[IO, Throwable, Int] = pureOf[IO](Left(new RuntimeException("Error"))).eitherT fa.rethrowTIfLeft // IO[Int] = RaiseError(RuntimeException("ERROR"))