On Sun, 6 Aug 2000, Mirko Pracht wrote:

> average x      | null x    = 0.0

What does you make thinking the average of an empty list is 0? Its'
obviously _|_, thus

average xs = sum xs / length xs

[which is inefficient, but simple]

Kili

-- 
_|_ is pronounced 'bottom', and is the greatest lower bound of a
complete lattice.

Nick Williams in comp.lang.functional


  • Re: Mirko Pracht
    • Matthias Kilian

Reply via email to