使用此代码:
main :: FilePath -> FilePath -> IO ()
main wrPath rdPath = do x <- readFile rdPath
writeFile wrPath x
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
Couldn't match expected type 'IO t0'
with actual type 'FilePath -> FilePath -> IO()
Run Code Online (Sandbox Code Playgroud)
但是当我将'main'的名称更改为其他名称时,文件会正确编译.
什么是主要的独特之处,为什么它的类型必须是IO t0?