Brad M
04/15/2021, 6:41 PMtraverseEither
for Map
, is there a parTraverseEither
?
This is what I have right now:
val items = // Map<K,V>
val newUrls = items.entries
.parTraverseEither { (key, value) -> doWork(key, value).map { Pair(key, it) } }
.map { it.associate { (first, second) -> first to second } }.bind()
simon.vergauwen
04/16/2021, 8:29 AMMap
but we can add it for sure 🙂
If you're interested in contributing it, I'd be happy to help!
I think you can write a version for it without having to Pair
twice to get it back into the map by combining the traverseEither
implementation ans parTraverseEither
implementation.simon.vergauwen
04/16/2021, 8:29 AM