Is there a straight-forward combination of standard higher-order functions to count the unique elements in a list?
For example the result for
[1, 1,
The simplest thing would be to sort the items into order, use "group" to put them into sub-lists of equal elements, and then count the items in each sub-list.
map (\xs -> (head xs, length xs)) . group . sort