Success

final case
class Success[E, A](a: A) extends Validation[E, A]
class Validation[E, A]
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Type members

Inherited classlikes

final
class SwitchingValidation[X](s: => X)
Inherited from
Validation

Value members

Concrete methods

Inherited methods

def +++(x: => Validation[E, A])(implicit M1: Semigroup[A], M2: Semigroup[E]): Validation[E, A]

Sums up values inside validation, if both are success or failure. Returns first failure otherwise.

Sums up values inside validation, if both are success or failure. Returns first failure otherwise.

success(v1) +++ success(v2) → success(v1 + v2)
success(v1) +++ failure(v2) → failure(v2)
failure(v1) +++ success(v2) → failure(v1)
failure(v1) +++ failure(v2) → failure(v1 + v2)
Inherited from
Validation
def +|+(x: Validation[E, A])(implicit es: Semigroup[E], as: Semigroup[A]): Validation[E, A]

If this and that are both success, or both a failure, combine them with the provided Semigroup for each. Otherwise, return the success. Alias for append

If this and that are both success, or both a failure, combine them with the provided Semigroup for each. Otherwise, return the success. Alias for append

Inherited from
Validation
def :?>>[X](success: => X): SwitchingValidation[X]

If this validation is success, return the given X value, otherwise, return the X value given to the return value.

If this validation is success, return the given X value, otherwise, return the X value given to the return value.

Inherited from
Validation
def ===(x: Validation[E, A])(implicit EE: Equal[E], EA: Equal[A]): Boolean

Compare two validations values for equality.

Compare two validations values for equality.

Inherited from
Validation
def @\/[EE, AA](k: E \/ A => EE \/ AA): Validation[EE, AA]

Run a disjunction function and back to validation again. Alias for disjunctioned

Run a disjunction function and back to validation again. Alias for disjunctioned

Inherited from
Validation
def andThen[EE >: E, B](f: A => Validation[EE, B]): Validation[EE, B]
Inherited from
Validation
def ap[B](x: => Validation[E, A => B])(implicit E: Semigroup[E]): Validation[E, B]

Apply a function in the environment of the success of this validation, accumulating errors.

Apply a function in the environment of the success of this validation, accumulating errors.

Inherited from
Validation
def append(that: Validation[E, A])(implicit es: Semigroup[E], as: Semigroup[A]): Validation[E, A]

If this and that are both success, or both a failure, combine them with the provided Semigroup for each. Otherwise, return the success. Alias for +|+

If this and that are both success, or both a failure, combine them with the provided Semigroup for each. Otherwise, return the success. Alias for +|+

Inherited from
Validation
def bimap[C, D](f: E => C, g: A => D): Validation[C, D]

Binary functor map on this validation.

Binary functor map on this validation.

Inherited from
Validation
def bitraverse[G[_] : Functor, C, D](f: E => G[C], g: A => G[D]): G[Validation[C, D]]

Binary functor traverse on this validation.

Binary functor traverse on this validation.

Inherited from
Validation
def compare(x: Validation[E, A])(implicit OE: Order[E], OA: Order[A]): Ordering

Compare two validations values for ordering.

Compare two validations values for ordering.

Inherited from
Validation
def disjunctioned[EE, AA](k: E \/ A => EE \/ AA): Validation[EE, AA]

Run a disjunction function and back to validation again. Alias for @\/

Run a disjunction function and back to validation again. Alias for @\/

Inherited from
Validation
def ensure(onFailure: => E)(f: A => Boolean): Validation[E, A]

Ensures that the success value of this validation satisfies the given predicate, or fails with the given value.

Ensures that the success value of this validation satisfies the given predicate, or fails with the given value.

Inherited from
Validation
def excepting(pf: PartialFunction[A, E]): Validation[E, A]

Return a Validation formed by the application of a partial function across the success of this value:

Return a Validation formed by the application of a partial function across the success of this value:

 strings map (_.parseInt excepting { case i if i < 0 => new Exception(s"Int must be positive: $i") })
Since

7.0.2

Inherited from
Validation
def exists(f: A => Boolean): Boolean

Return true if this validation is a success value satisfying the given predicate.

Return true if this validation is a success value satisfying the given predicate.

Inherited from
Validation
def filter(p: A => Boolean)(implicit M: Monoid[E]): Validation[E, A]

Filter on the success of this validation.

Filter on the success of this validation.

Inherited from
Validation
def findSuccess(that: => Validation[E, A])(implicit es: Semigroup[E]): Validation[E, A]

If this is a success, return it; otherwise, if that is a success, return it; otherwise, combine the failures with the specified semigroup.

If this is a success, return it; otherwise, if that is a success, return it; otherwise, combine the failures with the specified semigroup.

Inherited from
Validation
def fold[X](fail: E => X, succ: A => X): X

Catamorphism. Run the first given function if failure, otherwise, the second given function.

Catamorphism. Run the first given function if failure, otherwise, the second given function.

Inherited from
Validation
def foldConst[X](fail: => X, success: => X): X

If this validation is success, return success, otherwise, return fail.

If this validation is success, return success, otherwise, return fail.

Inherited from
Validation
def foldRight[B](z: => B)(f: (A, => B) => B): B

Fold on the success of this validation.

Fold on the success of this validation.

Inherited from
Validation
def forall(f: A => Boolean): Boolean

Return true if this validation is a failure value or the success value satisfies the given predicate.

Return true if this validation is a failure value or the success value satisfies the given predicate.

Inherited from
Validation
def foreach(f: A => Unit): Unit

Run the side-effect on the success of this validation.

Run the side-effect on the success of this validation.

Inherited from
Validation
def getOrElse[AA >: A](x: => AA): AA

Return the success value of this validation or the given default if failure. Alias for |

Return the success value of this validation or the given default if failure. Alias for |

Inherited from
Validation
def isFailure: Boolean

Return true if this validation is failure.

Return true if this validation is failure.

Inherited from
Validation
def isSuccess: Boolean

Return true if this validation is success.

Return true if this validation is success.

Inherited from
Validation
def leftMap[C](f: E => C): Validation[C, A]

Run the given function on the left value.

Run the given function on the left value.

Inherited from
Validation
def loopFailure[X](success: A => X, failure: E => X \/ Validation[E, A]): X

Spin in tail-position on the failure value of this validation.

Spin in tail-position on the failure value of this validation.

Inherited from
Validation
def loopSuccess[X](success: A => X \/ Validation[E, A], failure: E => X): X

Spin in tail-position on the success value of this validation.

Spin in tail-position on the success value of this validation.

Inherited from
Validation
def map[B](f: A => B): Validation[E, B]

Map on the success of this validation.

Map on the success of this validation.

Inherited from
Validation
def orElse(x: => Validation[E, A]): Validation[E, A]

Return this if it is a success, otherwise, return the given value. Alias for |||

Return this if it is a success, otherwise, return the given value. Alias for |||

Inherited from
Validation
def productElementNames: Iterator[String]
Inherited from
Product
def productIterator: Iterator[Any]
Inherited from
Product
def swap: Validation[A, E]

Flip the failure/success values in this validation. Alias for unary_~

Flip the failure/success values in this validation. Alias for unary_~

Inherited from
Validation
def swapped[EE, AA](k: Validation[A, E] => Validation[AA, EE]): Validation[EE, AA]

Run the given function on this swapped value. Alias for ~

Run the given function on this swapped value. Alias for ~

Inherited from
Validation
def toDisjunction: E \/ A

Convert to a disjunction.

Convert to a disjunction.

Inherited from
Validation
def toEither: Either[E, A]

Convert to a core scala.Either at your own peril.

Convert to a core scala.Either at your own peril.

Inherited from
Validation
def toIList[AA >: A]: IList[AA]

Return an empty ilist or an ilist with one element on the success of this validation.

Return an empty ilist or an ilist with one element on the success of this validation.

Inherited from
Validation
def toLazyList: LazyList[A]

Return an empty LazyList or LazyList with one element on the success of this validation.

Return an empty LazyList or LazyList with one element on the success of this validation.

Inherited from
Validation
def toList: List[A]

Return an empty list or a list with one element on the success of this validation.

Return an empty list or a list with one element on the success of this validation.

Inherited from
Validation
def toMaybe[AA >: A]: Maybe[AA]

Return an empty maybe or maybe with the element on the success of this validation. Useful to sweep errors under the carpet.

Return an empty maybe or maybe with the element on the success of this validation. Useful to sweep errors under the carpet.

Inherited from
Validation
def toOption: Option[A]

Return an empty option or option with one element on the success of this validation. Useful to sweep errors under the carpet.

Return an empty option or option with one element on the success of this validation. Useful to sweep errors under the carpet.

Inherited from
Validation

Wraps the failure value in a scalaz.NonEmptyList

Wraps the failure value in a scalaz.NonEmptyList

Inherited from
Validation
def traverse[G[_] : Applicative, B](f: A => G[B]): G[Validation[E, B]]

Traverse on the success of this validation.

Traverse on the success of this validation.

Inherited from
Validation
def unary_~: Validation[A, E]

Flip the failure/success values in this validation. Alias for swap

Flip the failure/success values in this validation. Alias for swap

Inherited from
Validation
def valueOr[AA >: A](x: E => AA): AA

Return the success value of this validation or run the given function on the failure.

Return the success value of this validation or run the given function on the failure.

Inherited from
Validation
def |[AA >: A](x: => AA): AA

Return the success value of this validation or the given default if failure. Alias for getOrElse

Return the success value of this validation or the given default if failure. Alias for getOrElse

Inherited from
Validation
def |||(x: => Validation[E, A]): Validation[E, A]

Return this if it is a success, otherwise, return the given value. Alias for orElse

Return this if it is a success, otherwise, return the given value. Alias for orElse

Inherited from
Validation
def ~[EE, AA](k: Validation[A, E] => Validation[AA, EE]): Validation[EE, AA]

Run the given function on this swapped value. Alias for swapped

Run the given function on this swapped value. Alias for swapped

Inherited from
Validation