object TryCompanionOps

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TryCompanionOps
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. def sequence[A, M[X] <: TraversableOnce[X]](in: M[commons.Try[A]])(implicit cbf: CanBuildFrom[M[commons.Try[A]], A, M[A]]): commons.Try[M[A]]

    Simple version of TryOps.traverse.

    Simple version of TryOps.traverse. Transforms a TraversableOnce[Try[A]] into a Try[TraversableOnce[A]]. Useful for reducing many Trys into a single Try.

  2. def traverse[A, B, M[X] <: TraversableOnce[X]](in: M[A])(fn: (A) ⇒ commons.Try[B])(implicit cbf: CanBuildFrom[M[A], B, M[B]]): commons.Try[M[B]]

    Transforms a TraversableOnce[A] into a Try[TraversableOnce[B]] using the provided function A => Try[B].

    Transforms a TraversableOnce[A] into a Try[TraversableOnce[B]] using the provided function A => Try[B]. For example, to apply a function to all items of a list:

    val myTryList = TryOps.traverse(myList)(x => Try(myFunc(x)))