groupWith

The groupWith function uses the user supplied function which projects an element out of every list element in order to to first sort the input list and then to form groups by equality on these projected elements