2009/3/27 Edward Z. Yang
<ezyang@mit.edu>
Hello all,
Hi
average :: Fractional a => [a] -> a
average list = sum list / fromIntegral (length list)
There was a thread on this ML which was about an implementation of average which avoids
traversing the list twice, one for 'sum' and one for 'length'. You could use it, if you care for
performance and your list is long enough to matter
Ciao
----------
FB