A quick example of how to take the average of a list in one pass:
listAvg :: (Fractional b) => [b] -> b
listAvg = uncurry (/) . foldl' (\(sum,cnt) x -> (sum + x, cnt + 1)) (0,0)
Some random code I've written. Everything is under Simplified BSD license, so help yourself!