averageList :: Fractional a => [a] -> a
averageList xs | length xs == 0 = 0
               | otherwise = sum xs / realToFrac (length xs)
averageList :: Fractional a => [a] -> a
averageList xs | length xs == 0 = 0
               | otherwise = sum xs / realToFrac (length xs)
averageList xs | length xs == 0 = 0
               | otherwise = sum xs / realToFrac (length xs)