Also note that I wrote in my first post that "Without the value-mapper argument it is very awkward to achieve the same structure after the group-by call". The `map-vals` function is almost the closest you can get to map values after a group-by in a streamlined and clean manner. There is `
fmap` in the contrib which does a similar thing already though.
An even cleaner mapper would be something like a `map-multi-vals`, so that you can do something like this:
(->> (group-by :type animals)
(map-multi-vals :name))
That's the cleanest one can get with a separate value-mapper. In my opinion that has little added benefit though, and possibly the performance is worse too. The only benefit would be separation of concern: you can map values of a multi-map without knowing how it was created. Now think about it: how often would you use `map-multi-vals` separately, not right after a
group-by? My impression is that whenever an multi-map is created, it almost always involves in some way a `group-by` - which itself is a special case of `reduce`. There is always a `reduce` somewhere, whether an `into`, a `for`, or some imperative iteration. Only `group-by` is the simplest for this specific purpose of creating a multi-map.
My argument therefore is that whenever you need a multi-value mapping, it is always preceded by a group-by, and therefore I feel the right place for the value-mapper is as an optional parameter for `group-by` itself.
What do you think?
Cheers,
Daniel