lift the try
into a F[_]
with ApplicativeError[F, Throwable]
instance
lift the try
into a F[_]
with ApplicativeError[F, Throwable]
instance
scala> import cats.implicits._ scala> import util.Try scala> val s: Try[Int] = Try(3) scala> s.liftTo[Either[Throwable, ?]] res0: Either[Throwable, Int] = Right(3) scala> val f: Try[Int] = Try(throw new Throwable("boo")) scala> f.liftTo[Either[Throwable, ?]] res0: Either[Throwable, Int] = Left(java.lang.Throwable: boo)