:: (a -> Bool) -> [a] -> [[a]] package:rebase

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