How would one best (read: most efficiently) create a histogram in Haskell? 
More precisely, given a list of integers in a known range, I want a count of 
how often any given number occurs.

In imperative languages this would be done by iterating over the list and 
updating the count for the element under consideration. Without updatable 
data structures, the most straightforward solution I can think of would start 
by sorting the list, but for a long list that is very inefficient.

Any suggestions?

Konrad.

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

Reply via email to