Nir
12/14/2021, 7:44 PMsome_stuff.groupBy { it }.mapValues { it.value.size }
Which works but feels a bit silly from a couple of anglesephemient
12/14/2021, 7:45 PMsome_stuff.groupingBy { it }.eachCount()
Nir
12/14/2021, 7:45 PMNir
12/14/2021, 7:45 PMMichael Böiers
12/14/2021, 8:03 PM{ it }
. In this case a small wrapper function (e.g. grouped()
) would be nice. It’s just much more readable in particular when in a nested lambda (e.g. flatMap)Luke
12/14/2021, 8:54 PMidentity
fonction: groupingBy(::identity)