This code seems a bit obtuse to me… Anyone care to help me out by explaining it?
uniq_c l = [ nl (tam l) i s | (s,i) <- uniq_c' l]
tam = maximum . map snd . uniq_c'
uniq_c' [] = []
uniq_c' (h:t) = let (list,rest) = span (==h) t
n = length list + 1
in (h,n) : uniq_c' rest
nl tam n line = let l = length $ show n
l_tam = length $ show tam
n' = replicate (l_tam-l) " "
in concat n' ++ show n ++ " " ++ line
uniq_cprovides a count of the number of times a string occurs in a list of strings concatenated with a space to the particular string:uniq_c'provides a list of tuples of(string,count).tamfinds the largest count (which will be the last occurrence for any particular string).nlindents the counts so that the counts are right justified.