这是代码,我尝试让类型推断找出函数的类型。当代码编译时,它在运行时失败。
Ambiguous type variables `b0', `m0' in the constraint:
(PersistBackend b0 m0) arising from a use of `isFree'
Probable fix: add a type signature that fixes these type variable(s)
In the expression: isFree testDay
In an equation for `it': it = isFree testDay
:t isFree
isFree :: PersistBackend b m => C.Day -> b m Bool
>isFree day = do
match <- selectList [TestStartDate ==. day,
TestStatus !=. Passed,
TestStatus !=. Failed] []
if (L.null match) then (liftIO $ return True) else (liftIO $ return False)