groupBy<K> method
Implementation
Map<K, List<T>> groupBy<K>(K Function(T) keyFunction) {
return fold(
<K, List<T>>{},
(Map<K, List<T>> map, T element) {
return map..putIfAbsent(keyFunction(element), () => <T>[]).add(element);
},
);
}