partition

fun <V, E> partition(vararg results: Result<V, E>): Pair<List<V>, List<E>>

Partitions a vararg of Results into a Pair of Lists. All the Ok elements are extracted, in order, to the first value. Similarly the Err elements are extracted to the Pair.second value.


fun <V, E> Iterable<Result<V, E>>.partition(): Pair<List<V>, List<E>>

Partitions an Iterable of Results into a Pair of Lists. All the Ok elements are extracted, in order, to the first value. Similarly the Err elements are extracted to the Pair.second value.