extra-0.2: Extra functions I use.

Safe HaskellSafe-Inferred

Control.Exception.Extra

Synopsis

Documentation

retry :: Int -> IO a -> IO aSource

showException :: SomeException -> IO StringSource

Print an exception, but if that exception itself contains exceptions, simply print <NestedException>. Since Haskell is a lazy language it is possible to throw exceptions that are themselves undefined. This function is useful to report them to users.

ignore :: IO () -> IO ()Source

Ignore any exceptions thrown by the action and continue as normal.

catch_ :: IO a -> (SomeException -> IO a) -> IO aSource

handle_ :: (SomeException -> IO a) -> IO a -> IO aSource

catchJust_ :: (SomeException -> Maybe b) -> IO a -> (b -> IO a) -> IO aSource

handleJust_ :: (SomeException -> Maybe b) -> (b -> IO a) -> IO a -> IO aSource

tryJust_ :: (SomeException -> Maybe b) -> IO a -> IO (Either b a)Source

catchBool :: Exception e => (e -> Bool) -> IO a -> (e -> IO a) -> IO aSource

handleBool :: Exception e => (e -> Bool) -> (e -> IO a) -> IO a -> IO aSource

tryBool :: Exception e => (e -> Bool) -> IO a -> IO (Either e a)Source