What is the best way to create a Map[K,V] from a Set[K] and function from K to V?
Map[K,V]
Set[K]
K
V
For example, suppose I have
The other solutions lack creativity. Here's my own version, though I'd really like to get rid of the _.head map.
_.head
s groupBy identity mapValues (_.head) mapValues func