<div dir="ltr"><div><div><div><div><div><div>Haskellers:<br><br></div>I want to write a function that takes a class name and reads from a file and then returns the<br></div>list of String of the file lines. I have experimented with various return types, but GHC does not like any of them. Here is my function:<br><br>readData :: String -> IO String   -- what type here??<br>readData classNameP = do<br>    let fileName = classNameP ++ ".txt"<br>    contents <- readFile fileName<br>    lines contents<br><br></div>Not to complain, but this would not be difficult in any other language I have tried, so I could use<br></div>some explanation. I suspect it has to do with understanding the IO Monad.<br><br></div>Many Thanks<br><br></div>Geoffrey<br></div>