try +base

try :: IO a -> IO (Either Exception a)
base Control.OldException
Similar to catch, but returns an Either result which is (Right a) if no exception was raised, or (Left e) if an exception was raised and its value is e. > try a = catch (Right `liftM` a) (return . Left) Note: as with catch, it is only polite to use this variant if you intend to re-throw the exception after performing whatever cleanup is needed. Otherwise, tryJust is generally considered to be better. Also note that System.IO.Error also exports a function called System.IO.Error.try with a similar type to try, except that it catches only the IO and user families of exceptions (as required by the Haskell 98 IO module).
try :: IO a -> IO (Either IOError a)
base System.IO.Error
The construct try comp exposes IO errors which occur within a computation, and which are not fully handled. Non-I/O exceptions are not caught by this variant; to catch all exceptions, use Control.Exception.try from Control.Exception.
try :: Exception e => IO a -> IO (Either e a)
base Control.Exception.Base, base Control.Exception
Similar to catch, but returns an Either result which is (Right a) if no exception of type e was raised, or (Left ex) if an exception of type e was raised and its value is ex. If any other type of exception is raised than it will be propogated up to the next enclosing exception handler. > try a = catch (Right `liftM` a) (return . Left) Note that System.IO.Error also exports a function called System.IO.Error.try with a similar type to Control.Exception.try, except that it catches only the IO and user families of exceptions (as required by the Haskell 98 IO module).
tryJust :: (Exception -> Maybe b) -> IO a -> IO (Either b a)
base Control.OldException
A variant of try that takes an exception predicate to select which exceptions are caught (c.f. catchJust). If the exception does not match the predicate, it is re-thrown.
tryJust :: Exception e => (e -> Maybe b) -> IO a -> IO (Either b a)
base Control.Exception.Base, base Control.Exception
A variant of try that takes an exception predicate to select which exceptions are caught (c.f. catchJust). If the exception does not match the predicate, it is re-thrown.
tryPutMVar :: MVar a -> a -> IO Bool
base Control.Concurrent.MVar
A non-blocking version of putMVar. The tryPutMVar function attempts to put the value a into the MVar, returning True if it was successful, or False otherwise.
tryTakeMVar :: MVar a -> IO (Maybe a)
base Control.Concurrent.MVar
A non-blocking version of takeMVar. The tryTakeMVar function returns immediately, with Nothing if the MVar was empty, or Just a if the MVar was full with contents a. After tryTakeMVar, the MVar is left empty.
throwErrnoIfMinus1Retry :: Num a => String -> IO a -> IO a
base Foreign.C.Error
Throw an IOError corresponding to the current value of getErrno if the IO action returns a result of -1, but retries in case of an interrupted operation.
throwErrnoIfMinus1Retry_ :: Num a => String -> IO a -> IO ()
base Foreign.C.Error
as throwErrnoIfMinus1, but discards the result.
throwErrnoIfMinus1RetryMayBlock :: Num a => String -> IO a -> IO b -> IO a
base Foreign.C.Error
as throwErrnoIfMinus1Retry, but checks for operations that would block.
throwErrnoIfMinus1RetryMayBlock_ :: Num a => String -> IO a -> IO b -> IO ()
base Foreign.C.Error
as throwErrnoIfMinus1RetryMayBlock, but discards the result.
throwErrnoIfNullRetry :: String -> IO (Ptr a) -> IO (Ptr a)
base Foreign.C.Error
Throw an IOError corresponding to the current value of getErrno if the IO action returns nullPtr, but retry in case of an interrupted operation.
throwErrnoIfNullRetryMayBlock :: String -> IO (Ptr a) -> IO b -> IO (Ptr a)
base Foreign.C.Error
as throwErrnoIfNullRetry, but checks for operations that would block.
throwErrnoIfRetry :: (a -> Bool) -> String -> IO a -> IO a
base Foreign.C.Error
as throwErrnoIf, but retry the IO action when it yields the error code eINTR - this amounts to the standard retry loop for interrupted POSIX system calls.
throwErrnoIfRetry_ :: (a -> Bool) -> String -> IO a -> IO ()
base Foreign.C.Error
as throwErrnoIfRetry, but discards the result.
throwErrnoIfRetryMayBlock :: (a -> Bool) -> String -> IO a -> IO b -> IO a
base Foreign.C.Error
as throwErrnoIfRetry, but additionally if the operation yields the error code eAGAIN or eWOULDBLOCK, an alternative action is executed before retrying.
throwErrnoIfRetryMayBlock_ :: (a -> Bool) -> String -> IO a -> IO b -> IO ()
base Foreign.C.Error
as throwErrnoIfRetryMayBlock, but discards the result.
oFFSET_snEntry_addr :: Int
base GHC.Constants
oFFSET_snEntry_sn_obj :: Int
base GHC.Constants
oFFSET_StgCatchRetryFrame_alt_code :: Int
base GHC.Constants

Show more results