Validated

sealed trait Validated[+A]

A validated value of type A can either be Valid or Invalid

Type parameters:
A

Type of the validated value

Companion:
object
class Object
trait Matchable
class Any
class Invalid
class Valid[A]

Value members

Concrete methods

def flatMap[B](f: A => Validated[B]): Validated[B]

Subsequently validates this valid value. An invalid value is returned as it is.

Subsequently validates this valid value. An invalid value is returned as it is.

def fold[B](valid: A => B, invalid: Seq[String] => B): B

Transforms this validated value into a value of type B

Transforms this validated value into a value of type B

def map[B](f: A => B): Validated[B]

Transforms a valid value of type A into a valid value of type B. An invalid value is returned as it is.

Transforms a valid value of type A into a valid value of type B. An invalid value is returned as it is.

Transforms the error list of an invalid value. A valid value is returned as it is.

Transforms the error list of an invalid value. A valid value is returned as it is.

Transforms this Validated[A] value into an Either[Seq[String], A] value.

Transforms this Validated[A] value into an Either[Seq[String], A] value.

def zip[A0 >: A, B](that: Validated[B])(implicit tupler: Tupler[A0, B]): Validated[Out]

Tuples together two validated values and tries to return a flat tuple instead of nested tuples. Also strips out Unit values in the tuples.

Tuples together two validated values and tries to return a flat tuple instead of nested tuples. Also strips out Unit values in the tuples.

If this and that are both invalid values, this operation returns an Invalid value containing both this error messages and that error messages.

See also: