diff options
author | Will Thompson <will@willthompson.co.uk> | 2017-07-26 10:11:11 +0100 |
---|---|---|
committer | Will Thompson <will@willthompson.co.uk> | 2017-07-26 10:11:43 +0100 |
commit | 95ad3ded72efdd92af70e3cea9b7923f60fd184c (patch) | |
tree | 494abc68641cdb3a5606ae74aa4a80771ef0e0db | |
parent | 980131368f021e851cbee62f1a49d7bd2e80ece6 (diff) |
Stats: expunge a call to "error"
This gives mean [] => NaN which seems no less correct than aborting the
program!
-rw-r--r-- | Bustle/Stats.hs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Bustle/Stats.hs b/Bustle/Stats.hs index 3ac8ce2..9e14178 100644 --- a/Bustle/Stats.hs +++ b/Bustle/Stats.hs @@ -72,8 +72,7 @@ frequencies = reverse mean :: (Eq a, Fractional a) => [a] -> a mean = acc 0 0 - where acc 0 _ [] = error "mean of empty list" - acc n t [] = t / n + where acc n t [] = t / n acc n t (x:xs) = acc (n + 1) (t + x) xs data TimeInfo = |