vavr icon indicating copy to clipboard operation
vavr copied to clipboard

Collect to map while dealing with collisions

Open patrickguenther opened this issue 3 years ago • 1 comments

I would like to collect a stream of objects into a map, while dealing with duplicate keys analogous to the Java collector Collectors::toMap(Function, Function, BinaryOperator). Is there a canonical way of doing that?

patrickguenther avatar Jul 14 '22 08:07 patrickguenther

Will Traversable.toMap do what you want?

dbear496 avatar Jul 17 '22 20:07 dbear496

Of course, yes, I think that's what I was looking for. Edit: I think this method is not available in the pre-alpha versions. Guess I need to upgrade.

patrickguenther avatar Sep 30 '22 16:09 patrickguenther