sealed abstract class Checked[+A, +N, +R] extends Product with Serializable
A monad for aborting and non-aborting errors. Non-aborting errors are accumulated in a cats.data.Chain
until the first aborting error is hit. You can think of com.digitalasset.canton.util.Checked as an extension of
Either
to also support errors that should not cause the computation to abort.
- A
Type of aborting errors
- N
Type of non-aborting errors
- R
Result type of the monad
- Alphabetic
- By Inheritance
- Checked
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def abortFlatMap[AA, NN >: N, RR >: R](f: (A) => Checked[AA, NN, RR]): Checked[AA, NN, RR]
- def ap[AA >: A, NN >: N, RR](f: Checked[AA, NN, (R) => RR]): Checked[AA, NN, RR]
Applicative operation.
Applicative operation. Consistent with the monadic flatMap according to Cats' laws, i.e.,
x.ap(f) = for { g <- f; y <- x } yield g(x)
- def appendNonabort[NN >: N](nonabort: NN): Checked[A, NN, R]
- def appendNonaborts[NN >: N](nonaborts: Chain[NN]): Checked[A, NN, R]
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def biflatMap[AA, NN >: N, RR](f: (A) => Checked[AA, NN, RR], g: (R) => Checked[AA, NN, RR]): Checked[AA, NN, RR]
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def exists(pred: (R) => Boolean): Boolean
- def flatMap[AA >: A, NN >: N, RR](f: (R) => Checked[AA, NN, RR]): Checked[AA, NN, RR]
- def fold[B](f: (A, Chain[N]) => B, g: (Chain[N], R) => B): B
- def forall(pred: (R) => Boolean): Boolean
- def foreach(f: (R) => Unit): Unit
- def getAbort: Option[A]
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def getResult: Option[R]
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def isAbort: Boolean
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isResult: Boolean
- def map[RR](f: (R) => RR): Checked[A, N, RR]
- def mapAbort[AA](f: (A) => AA): Checked[AA, N, R]
- def mapNonabort[NN](f: (N) => NN): Checked[A, NN, R]
- def mapNonaborts[NN](f: (Chain[N]) => Chain[NN]): Checked[A, NN, R]
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def prependNonabort[NN >: N](nonabort: NN): Checked[A, NN, R]
- def prependNonaborts[NN >: N](nonaborts: Chain[NN]): Checked[A, NN, R]
- def product[AA >: A, NN >: N, RR](other: Checked[AA, NN, RR]): Checked[AA, NN, (R, RR)]
Applicative product operation.
Applicative product operation. Errors from
this
take precedence overother
- def productElementName(n: Int): String
- Definition Classes
- Product
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- def productIterator: Iterator[Any]
- Definition Classes
- Product
- def productPrefix: String
- Definition Classes
- Product
- def reverseAp[AA >: A, NN >: N, RR](f: Checked[AA, NN, (R) => RR]): Checked[AA, NN, RR]
Reverse applicative operation.
Reverse applicative operation. Errors from the argument (=
this
) take precedence over those from the function. - def successful: Boolean
Is a Checked.Result with no errors
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toEither: Either[A, R]
Discards nonaborts.
- def toEitherMergeNonaborts[L >: N](implicit ev: <:<[A, NonEmptyChain[L]]): Either[NonEmptyChain[L], R]
Discards the result if there are nonaborts.
- def toEitherWithNonaborts[L, A1 >: A <: L, N1 >: N <: L]: Either[NonEmptyChain[L], R]
Discards the result if there are nonaborts.
- def toOption: Option[R]
- def toResult[NN, RR >: R, A1 >: A <: NN, N1 >: N <: NN](default: => RR): Checked[Nothing, NN, RR]
Merges aborts with nonaborts, using the given
default
result if no result is contained. - def toString(): String
- Definition Classes
- AnyRef → Any
- def traverse[F[_], AA >: A, NN >: N, RR](f: (R) => F[RR])(implicit F: Applicative[F]): F[Checked[AA, NN, RR]]
When Checked.Result, apply the function, marking the result as Checked.Result inside the Applicative's context, keeping the warnings.
When Checked.Result, apply the function, marking the result as Checked.Result inside the Applicative's context, keeping the warnings. when Checked.Abort, lift the Checked.Abort into the Applicative's context
- def trimap[AA, NN, RR](abortMap: (A) => AA, nonabortMap: (N) => NN, resultMap: (R) => RR): Checked[AA, NN, RR]
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])