I don't think this package works as expected. Consider the following:
import Control.Concurrent
import Control.Exception.Async
import System.Timeout
main :: IO ()
main = do
timeout 1000000 $ do
threadDelay 10000000 `catchSync` \e -> do
print e
threadDelay 10000000
return ()
The expected behavior would be that the timeout- an async exception- would kill the thread delay, the catch would ignore the async exception, and the program would exit. In reality, catchSync treats the timeout as a synchronous exception, prints it, and delays once again. Compare this to classy-prelude's catchAny, which handles the situation correctly, via the technique I described in "Catching all exceptions."[1]
In this case, the issue is that the timeout exception type is not recognized as async, and a special case could be added to handle that exception type[2]. However, I think the overall approach of determining *how* an exception was thrown based on *what* was thrown is not tenable.
[2] It's a bit difficult to do so, since IIRC the type is never exported. But a hack using the Typeable instance- while ugly- is likely possible.