aggregate
inline fun <T> Iterable<KotlinResult<T>>.aggregate(reduce: (List<Throwable>) -> Throwable): KotlinResult<List<T>>
If all results in the Iterable are success,
returns
a new KotlinResult success, with a List of each element's encapsulated value.If any results in the Iterable are failure,
returns
a new KotlinResult failure with the result of the reduce function.