Simple version of TryOps.traverse
.
Simple version of TryOps.traverse
. Transforms a TraversableOnce[Try[A]]
into a Try[TraversableOnce[A]]
.
Useful for reducing many Try
s into a single Try
.
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)))