Whe I type out into terminal the code below, it can successfully display all the detail I need.
avg "Vivo" testDatabase
But when I try to show that it works with the code below, it gives me an error - It couldn't match type 'Float' with '[Char]'. How should I try to fix this error?
--the function for code
avg :: String -> [Spa] -> Float
avg avgAreaRating spas = fromIntegral (sum lvlrating) / fromIntegral (length lvlrating)
where area = spaArea avgAreaRating spas
lvlrating = concatMap getLevelRating area
--code
show 5 = putStrLn $ avg "Vivo" testDatabase