`groupBy` returns a `Map<Key, List<T>>` keyed by what the lambda returns. `partition` is a special-case `groupBy` for booleans — returns `(matching, nonMatching)` Pair.
A dict-returning groupby that doesn't require sorted input. Like itertools.groupby but materializes the groups so consumers can iterate them multiple times.
Group a list into a record keyed by whatever the callback returns. Like Lodash _.groupBy or the new Object.groupBy in modern runtimes. Generic enough to handle string, number, or symbol keys.