Here's a small program that replicates the compilation issue I'm seeing:
import qualified System.Posix.Files
get_size :: String -> IO Integer
get_size filename = do
file_status <- System.Posix.Files.getFileStatus filename
let file_size = System.Posix.Files.fileSize file_status
let integer_file_size = fromIntegral file_size
return integer_file_size
main :: IO ()
main = do
let filenames = ["/etc/services"]
let sizes = map get_size filenames
mapM_ print sizes
The compilation error I get is:I've googled quite a bit, and guessed quite a bit, and added type declarations some, but I'm still not converging on a solution.
Why can't I print an IO Integer?
Thanks!