Class

scalaz

Success

Related Doc: package scalaz

Permalink

final case class Success[A](a: A) extends Validation[Nothing, A] with Product with Serializable

Source
Validation.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Success
  2. Validation
  3. Serializable
  4. Serializable
  5. Product
  6. Equals
  7. AnyRef
  8. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Success(a: A)

    Permalink

Type Members

  1. final class SwitchingValidation[X] extends AnyRef

    Permalink
    Definition Classes
    Validation

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def +++[EE >: Nothing, AA >: A](x: ⇒ Validation[EE, AA])(implicit M1: Semigroup[AA], M2: Semigroup[EE]): Validation[EE, AA]

    Permalink

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

    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)
    Definition Classes
    Validation
  4. def +|+[EE >: Nothing, AA >: A](x: Validation[EE, AA])(implicit es: Semigroup[EE], as: Semigroup[AA]): Validation[EE, AA]

    Permalink

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

    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

    Definition Classes
    Validation
  5. def :?>>[X](success: ⇒ X): SwitchingValidation[X]

    Permalink

    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.

    Definition Classes
    Validation
  6. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  7. def ===[EE >: Nothing, AA >: A](x: Validation[EE, AA])(implicit EE: Equal[EE], EA: Equal[AA]): Boolean

    Permalink

    Compare two validations values for equality.

    Compare two validations values for equality.

    Definition Classes
    Validation
  8. def @\/[EE, AA](k: (\/[Nothing, A]) ⇒ \/[EE, AA]): Validation[EE, AA]

    Permalink

    Run a disjunction function and back to validation again.

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

    Definition Classes
    Validation
  9. val a: A

    Permalink
  10. def andThen[EE >: Nothing, B](f: (A) ⇒ Validation[EE, B]): Validation[EE, B]

    Permalink
    Definition Classes
    Validation
  11. def ap[EE >: Nothing, B](x: ⇒ Validation[EE, (A) ⇒ B])(implicit E: Semigroup[EE]): Validation[EE, B]

    Permalink

    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.

    Definition Classes
    Validation
  12. def append[EE >: Nothing, AA >: A](that: Validation[EE, AA])(implicit es: Semigroup[EE], as: Semigroup[AA]): Validation[EE, AA]

    Permalink

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

    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 +|+

    Definition Classes
    Validation
  13. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  14. def bimap[C, D](f: (Nothing) ⇒ C, g: (A) ⇒ D): Validation[C, D]

    Permalink

    Binary functor map on this validation.

    Binary functor map on this validation.

    Definition Classes
    Validation
  15. def bitraverse[G[_], C, D](f: (Nothing) ⇒ G[C], g: (A) ⇒ G[D])(implicit arg0: Functor[G]): G[Validation[C, D]]

    Permalink

    Binary functor traverse on this validation.

    Binary functor traverse on this validation.

    Definition Classes
    Validation
  16. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  17. def compare[EE >: Nothing, AA >: A](x: Validation[EE, AA])(implicit EE: Order[EE], EA: Order[AA]): Ordering

    Permalink

    Compare two validations values for ordering.

    Compare two validations values for ordering.

    Definition Classes
    Validation
  18. def disjunction: \/[Nothing, A]

    Permalink

    Convert to a disjunction.

    Convert to a disjunction.

    Definition Classes
    Validation
  19. def disjunctioned[EE, AA](k: (\/[Nothing, A]) ⇒ \/[EE, AA]): Validation[EE, AA]

    Permalink

    Run a disjunction function and back to validation again.

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

    Definition Classes
    Validation
  20. def ensure[EE >: Nothing](onFailure: ⇒ EE)(f: (A) ⇒ Boolean): Validation[EE, A]

    Permalink

    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.

    Definition Classes
    Validation
  21. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  22. def excepting[EE >: Nothing](pf: PartialFunction[A, EE]): Validation[EE, A]

    Permalink

    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") })
    Definition Classes
    Validation
    Since

    7.0.2

  23. def exists(f: (A) ⇒ Boolean): Boolean

    Permalink

    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.

    Definition Classes
    Validation
  24. def filter[EE >: Nothing](p: (A) ⇒ Boolean)(implicit M: Monoid[EE]): Validation[EE, A]

    Permalink

    Filter on the success of this validation.

    Filter on the success of this validation.

    Definition Classes
    Validation
  25. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  26. def findSuccess[EE >: Nothing, AA >: A](that: ⇒ Validation[EE, AA])(implicit es: Semigroup[EE]): Validation[EE, AA]

    Permalink

    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.

    Definition Classes
    Validation
  27. def fold[X](fail: (Nothing) ⇒ X, succ: (A) ⇒ X): X

    Permalink

    Catamorphism.

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

    Definition Classes
    Validation
  28. def foldRight[B](z: ⇒ B)(f: (A, ⇒ B) ⇒ B): B

    Permalink

    Fold on the success of this validation.

    Fold on the success of this validation.

    Definition Classes
    Validation
  29. def forall(f: (A) ⇒ Boolean): Boolean

    Permalink

    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.

    Definition Classes
    Validation
  30. def foreach[U](f: (A) ⇒ U): Unit

    Permalink

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

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

    Definition Classes
    Validation
  31. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  32. def getOrElse[AA >: A](x: ⇒ AA): AA

    Permalink

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

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

    Definition Classes
    Validation
  33. def isFailure: Boolean

    Permalink

    Return true if this validation is failure.

    Return true if this validation is failure.

    Definition Classes
    Validation
  34. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  35. def isSuccess: Boolean

    Permalink

    Return true if this validation is success.

    Return true if this validation is success.

    Definition Classes
    Validation
  36. def leftMap[C](f: (Nothing) ⇒ C): Validation[C, A]

    Permalink

    Run the given function on the left value.

    Run the given function on the left value.

    Definition Classes
    Validation
  37. def loopFailure[EE >: Nothing, AA >: A, X](success: (AA) ⇒ X, failure: (EE) ⇒ \/[X, Validation[EE, AA]]): X

    Permalink

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

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

    Definition Classes
    Validation
  38. def loopSuccess[EE >: Nothing, AA >: A, X](success: (AA) ⇒ \/[X, Validation[EE, AA]], failure: (EE) ⇒ X): X

    Permalink

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

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

    Definition Classes
    Validation
  39. def map[B](f: (A) ⇒ B): Validation[Nothing, B]

    Permalink

    Map on the success of this validation.

    Map on the success of this validation.

    Definition Classes
    Validation
  40. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  41. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  42. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  43. def orElse[EE >: Nothing, AA >: A](x: ⇒ Validation[EE, AA]): Validation[EE, AA]

    Permalink

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

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

    Definition Classes
    Validation
  44. def show[EE >: Nothing, AA >: A](implicit SE: Show[EE], SA: Show[AA]): Cord

    Permalink

    Show for a validation value.

    Show for a validation value.

    Definition Classes
    Validation
  45. def swap: Validation[A, Nothing]

    Permalink

    Flip the failure/success values in this validation.

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

    Definition Classes
    Validation
  46. def swapped[EE, AA](k: (Validation[A, Nothing]) ⇒ Validation[AA, EE]): Validation[EE, AA]

    Permalink

    Run the given function on this swapped value.

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

    Definition Classes
    Validation
  47. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  48. def toEither: Either[Nothing, A]

    Permalink

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

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

    Definition Classes
    Validation
  49. def toList: List[A]

    Permalink

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

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

    Definition Classes
    Validation
  50. def toMaybe[AA >: A]: Maybe[AA]

    Permalink

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

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

    Definition Classes
    Validation
  51. def toOption: Option[A]

    Permalink

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

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

    Definition Classes
    Validation
  52. def toStream: Stream[A]

    Permalink

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

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

    Definition Classes
    Validation
  53. def toValidationNel[EE >: Nothing, AA >: A]: ValidationNel[EE, AA]

    Permalink

    Wraps the failure value in a scalaz.NonEmptyList

    Wraps the failure value in a scalaz.NonEmptyList

    Definition Classes
    Validation
  54. def traverse[G[_], EE >: Nothing, B](f: (A) ⇒ G[B])(implicit arg0: Applicative[G]): G[Validation[EE, B]]

    Permalink

    Traverse on the success of this validation.

    Traverse on the success of this validation.

    Definition Classes
    Validation
  55. def unary_~: Validation[A, Nothing]

    Permalink

    Flip the failure/success values in this validation.

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

    Definition Classes
    Validation
  56. def valueOr[AA >: A](x: (Nothing) ⇒ AA): AA

    Permalink

    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.

    Definition Classes
    Validation
  57. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  58. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  59. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  60. def |[AA >: A](x: ⇒ AA): AA

    Permalink

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

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

    Definition Classes
    Validation
  61. def |||[EE >: Nothing, AA >: A](x: ⇒ Validation[EE, AA]): Validation[EE, AA]

    Permalink

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

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

    Definition Classes
    Validation
  62. def ~[EE, AA](k: (Validation[A, Nothing]) ⇒ Validation[AA, EE]): Validation[EE, AA]

    Permalink

    Run the given function on this swapped value.

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

    Definition Classes
    Validation

Inherited from Validation[Nothing, A]

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped