With this code:
main :: FilePath -> FilePath -> IO ()
main wrPath rdPath = do x <- readFile rdPath
writeFile wrPath x
I got the following error:
Couldn't match expected type 'IO t0'
with actual type 'FilePath -> FilePath -> IO()
But the file compiles correctly when I change the name of ‘main’ to something else.
What’s so unique about main and why does its type have to be IO t0?
Because the language spec says so.