<div dir="ltr"><div><div><div><div><div>My main function looks like this:<br><br>main :: [IO()]<br>main = do<br>    let stud1 = Student {name = "Geoff", average = -99.0, grades = [66,77,88]}<br>    let stud2 = Student {name = "Doug", average = -99.0, grades = [77,88,99]}<br>    let stud3 = Student {name = "Ron", average = -99.0, grades = [55,66,77]}<br>    let studList = [stud1,stud2]<br>    let newList = calcAvg studList<br>    [putStrLn $ show s | s <- newList]<br>    --putStrLn $ show (newList !! 0)<br>    --putStrLn $ show (newList !! 1)<br><br></div>With this final line, putStrLn $ show (newList !! 0), the type IO () in the function declaration compiles fine.<br></div>But with [putStrLn $ show s | s <- newList] as the final line, [IO ()] in the function declaration will not compile, I get this error:<br><br>    Couldn't match expected type `IO t0' with actual type `[IO ()]'<br><br></div>What does the declared type need to be for a final line of:<br> [putStrLn $ show s | s <- newList]  ???<br><br></div>Thanks,<br><br></div>Geoffrey<br><div><div><br></div></div></div>