Packages

c

cats.syntax

ApplicativeErrorOps

final class ApplicativeErrorOps[F[_], E, A] extends AnyVal

Source
applicativeError.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ApplicativeErrorOps
  2. AnyVal
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ApplicativeErrorOps(fa: F[A])

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    Any
  2. final def ##(): Int
    Definition Classes
    Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    Any
  4. def adaptErr(pf: PartialFunction[E, E])(implicit F: ApplicativeError[F, E]): F[A]

    Transform certain errors using pf and rethrow them.

    Transform certain errors using pf and rethrow them. Non matching errors and successful values are not affected by this function.

    Example:

    scala> import cats._, implicits._
    
    scala> def pf: PartialFunction[String, String] = { case "error" => "ERROR" }
    
    scala> "error".asLeft[Int].adaptErr(pf)
    res0: Either[String,Int] = Left(ERROR)
    
    scala> "err".asLeft[Int].adaptErr(pf)
    res1: Either[String,Int] = Left(err)
    
    scala> 1.asRight[String].adaptErr(pf)
    res2: Either[String,Int] = Right(1)

    This is the same as MonadErrorOps#adaptError. It cannot have the same name because this would result in ambiguous implicits. adaptError will be moved from MonadError to ApplicativeError in Cats 2.0: see https://github.com/typelevel/cats/issues/2685

  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def attempt(implicit F: ApplicativeError[F, E]): F[Either[E, A]]
  7. def attemptT(implicit F: ApplicativeError[F, E]): EitherT[F, E, A]
  8. def getClass(): Class[_ <: AnyVal]
    Definition Classes
    AnyVal → Any
  9. def handleError(f: (E) ⇒ A)(implicit F: ApplicativeError[F, E]): F[A]
  10. def handleErrorWith(f: (E) ⇒ F[A])(implicit F: ApplicativeError[F, E]): F[A]
  11. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  12. def onError(pf: PartialFunction[E, F[Unit]])(implicit F: ApplicativeError[F, E]): F[A]
  13. def orElse(other: ⇒ F[A])(implicit F: ApplicativeError[F, E]): F[A]
  14. def recover(pf: PartialFunction[E, A])(implicit F: ApplicativeError[F, E]): F[A]
  15. def recoverWith(pf: PartialFunction[E, F[A]])(implicit F: ApplicativeError[F, E]): F[A]
  16. def toString(): String
    Definition Classes
    Any

Inherited from AnyVal

Inherited from Any

Ungrouped