I'm looking for a straight-forward combination of standard higher-order functions to compress a list by counting repetitive elements. For example the result for
"abbccccb"
would be :
[(1, 'a'), (2, 'b'), (4, 'c'), (1, 'b')]
another example, the result for
(sort "abrakadabra")
would be:
[(5, 'a'), (2, 'b'), (1, 'd'), (1, 'k'), (2, 'r')]