Konrad Hinsen hinsen@cnrs-orleans.fr
Wed, 3 Sep 2003 15:13:30 +0200

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=
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 s=
by sorting the list, but for a long list that is very inefficient.

Any suggestions?