为什么此代码适用于
import qualified Control.OldException as E
但不与
import qualified Control.Exception as E
这是代码:
fileContents <- (readFile "shpm.txt") `E.catch` (\_ -> return "")
这是我遇到的“新”异常错误
Ambiguous type variable `e0' in the constraint:
(E.Exception e0) arising from a use of `E.catch'
Probable fix: add a type signature that fixes these type variable(s)
In a stmt of a 'do' block:
fileContents <- (readFile "shpm.txt")
`E.catch` (\ _ -> return "No Tasks")