try package:unliftio

Run the given action and catch any synchronous exceptions as a Left value. This is parameterized on the exception type. To catch all synchronous exceptions, use tryAny.
try specialized to catch all synchronous exceptions.
tryDeep specialized to catch all synchronous exceptions.
Same as try, but fully force evaluation of the result value to find all impure exceptions.
try specialized to only catching IOExceptions.
A variant of try that takes an exception predicate to select which exceptions are caught.
A variant of try that catches both synchronous and asynchronous exceptions. See catchSyncOrAsync.
Lifted tryPutMVar.
Lifted tryReadMVar.
Lifted tryTakeMVar.
A version of peekTBQueue which does not retry. Instead it returns Nothing if no value is available.
A version of peekTChan which does not retry. Instead it returns Nothing if no value is available.
A version of peekTQueue which does not retry. Instead it returns Nothing if no value is available.
A version of putTMVar that does not retry. The tryPutTMVar function attempts to put the value a into the TMVar, returning True if it was successful, or False otherwise.
A version of readTBQueue which does not retry. Instead it returns Nothing if no value is available.
A version of readTChan which does not retry. Instead it returns Nothing if no value is available.
A version of readTMVar which does not retry. Instead it returns Nothing if no value is available.
A version of readTQueue which does not retry. Instead it returns Nothing if no value is available.
A version of takeTMVar that does not retry. The tryTakeTMVar function returns Nothing if the TMVar was empty, or Just a if the TMVar was full with contents a. After tryTakeTMVar, the TMVar is left empty.
Evaluate the value to WHNF and catch any synchronous exceptions. The expression may still have bottom values within it; you may instead want to use pureTryDeep.
Evaluate the value to NF and catch any synchronous exceptions.