I want to take the temperature from all the data in the cities array and output the data in fahrenheit.
Everything ive tried doesnt seem to work, as you can see getAllTempsF was my most recent attempt.
C to F is (c*1.8)+18
data City = City { cityName :: String
, temperature :: [Double]
}
city1 = City {cityName = "city1", temperature = [4.50,6.50,5.0,6.48,8.54]}
city2 = City {cityName = "city2", temperature = [6.35,5.12,3.21,3.25,4.56]}
city3 = City {cityName = "city3", temperature = [7.3,5.32,4.4,4.6]}
cities :: [City]
cities = [city1,city2,city3]
getAllNames :: [City] -> [String]
getAllNames x = map cityName x
getAllTemps :: [City] -> [[Double]]
getAllTemps x = map temperature x
getAllTempsF :: [City] -> [[Double]]
getAllTempsF [] = 1
getAllTempsF (x:xs) = [((x * 1.8) + 32)..] >> getAllTempsF xs