Collect<T, E> extension

Methods on Iterable<Result<T, E>>

on

Methods

collect() Result<Iterable<T>, E>
Convert an Iterable<Result<T, E>> to a Result<Iterable<T>, E>. If there is an Err in the iterable the first Err is returned.
collectOr(T fallback) Iterable<T>
Converts an Iterable<Result<T, E>> to a <Iterable<T>. All Err values are replaced by the provided fallback.
collectOrElse(T errMap(E error)) Iterable<T>
Converts an Iterable<Result<T, E>> to a <Iterable<T>. All Err values are replaced by the result of the provided function.
sieve() Iterable<T>
Converts an Iterable<Result<T, E>> to a <Iterable<T>. All Err values are skipped.
sieveErr() Iterable<E>
Converts an Iterable<Result<T, E>> to a <Iterable<E>. All Ok values are skipped.