In Haskell, how do I get an average float from a list of integers?
问题 I have written a simple function that displays: Name of place, Degrees North, Degrees East, and a list of rainfall numbers. How do I get an average rainfall specific to a place? For example in my code, how do I get an average rainfall for London? Sorry if my code is not the best, I'm just learning Haskell. import Data.Char import Data.List type Place = (String, Float, Float, [Int]) testData :: [Place] testData = [("London", 51.5, -0.1, [0, 0, 5, 8, 8, 0, 0]), ("Cardiff", 51.5, -3.2, [12, 8,