Hello everybody.

I have a long list consisted of a small number (about a dozen) of elements repeating in random pattern. I know all the possible elements.
I need to count number of occurences of each particular element and to do i quickly.


   For example
quick_func Eq a => [a] -> [(a,Int)]
quick_func [1,2,3,1,2,9,1,9] == [(1,3),(2,2),(3,1),(9,2)]

According to profiler this function is the bottle-neck in my sluggish program so I really need to speed it up.

Any proposals?

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to