Validation

Companion
class
trait Sum
trait Mirror
class Object
trait Matchable
class Any

Type members

Classlikes

object FlatMap

Import this if you wish to use flatMap

Import this if you wish to use flatMap

Inherited types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Inherited from
Mirror
type MirroredLabel <: String

The name of the type

The name of the type

Inherited from
Mirror
type \?/[E, A] = Validation[E, A]
Inherited from
ValidationInstances

Value members

Concrete methods

def f[B]: F[B]

Construct a failure validation value but specify only the success type param

Construct a failure validation value but specify only the success type param

Example
 val x = Validation.f[String](42)
 x: Validation[Int, String]
def failure[E, A]: E => Validation[E, A]

Construct a failure validation value.

Construct a failure validation value.

def failureNel[E, A](e: E): ValidationNel[E, A]

Wrap a value in a NonEmptyList and construct a failure validation out of it.

Wrap a value in a NonEmptyList and construct a failure validation out of it.

def fromEither[E, A](e: Either[E, A]): Validation[E, A]

Construct a Validation from an Either.

Construct a Validation from an Either.

def lift[E, A](a: A)(f: A => Boolean, fail: E): Validation[E, A]
def liftNel[E, A](a: A)(f: A => Boolean, fail: E): ValidationNel[E, A]
@tailrec
final
def loopFailure[E, A, X](d: Validation[E, A], success: A => X, failure: E => X \/ Validation[E, A]): X

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

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

@tailrec
final
def loopSuccess[E, A, X](d: Validation[E, A], success: A => X \/ Validation[E, A], failure: E => X): X

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

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

def s[B]: S[B]

Construct a success validation value but specify only the failure type param

Construct a success validation value but specify only the failure type param

Example
 val x = Validation.s[String](42)
 x: Validation[String, Int]
def success[E, A]: A => Validation[E, A]

Construct a success validation value.

Construct a success validation value.

Deprecated methods

@deprecated("Throwable is not referentially transparent, use \\/.attempt", "7.3.0")
def fromTryCatchNonFatal[T](a: => T): Validation[Throwable, T]
Deprecated
@deprecated("Throwable is not referentially transparent, use \\/.attempt", "7.3.0")
def fromTryCatchThrowable[T, E <: Throwable : NotNothing](a: => T)(implicit evidence$3: NotNothing[E], ex: ClassTag[E]): Validation[E, T]
Deprecated

Implicits

Inherited implicits

implicit
def ValidationApplicativeError[L : Semigroup]: ApplicativeError[[_] =>> Validation[L, _$24], L] & Alt[[_] =>> Validation[L, _$25]]
Inherited from
ValidationInstances3
implicit
Inherited from
ValidationInstances1
implicit
def ValidationInstances1[L]: Traverse[[_] =>> Validation[L, _$10]] & Cozip[[_] =>> Validation[L, _$11]] & Optional[[_] =>> Validation[L, _$12]]
Inherited from
ValidationInstances2
implicit
Inherited from
ValidationInstances3
implicit
Inherited from
ValidationInstances0
implicit
Inherited from
ValidationInstances0
implicit
def ValidationPlus[E : Semigroup]: Plus[[_] =>> Validation[E, _$17]]
Inherited from
ValidationInstances2
implicit
def ValidationShow[E : Show, A : Show]: Show[Validation[E, A]]
Inherited from
ValidationInstances1