I'm struck that Multimap.toJavaMap() exists, but Multimap.toMap() does not.
multimap.keySet().toMap(Function.identity(), key -> multimap.getOrElse(key, Set())) is a bit much.
Should there be a new method here to make it simpler (similar to #1274)?
Hi @skestle,
sorry for the late answer.
We can add it to master (v0.9.x).v1.0 is still in the design stage.
I wanted to help, but I might be missing something: Multimap already has a method called asMap(), which appears to do what I'd expect. I found only one test, which turns Multimap { 1 => 2, 1 => 3 } into Map { 1 => [2, 3] }. This at least suggests exactly the same thing as @skestle seems to expect.
Were you look for something else, @skestle?
Multimap will probably not part of Vavr 1. We want to focus on the most frequently used collections. Maybe we will release some kind of add-on collections package later.
Most helpful comment
I wanted to help, but I might be missing something:
Multimapalready has a method calledasMap(), which appears to do what I'd expect. I found only one test, which turnsMultimap { 1 => 2, 1 => 3 }intoMap { 1 => [2, 3] }. This at least suggests exactly the same thing as @skestle seems to expect.Were you look for something else, @skestle?