Safe Haskell | Safe-Inferred |
---|
Utilities for exceptions.
Synopsis
- ignoreEnoent :: IO a -> IO (Maybe a)
- ignoreEnoent_ :: IO a -> IO ()
- ignoreEOF :: IO a -> IO (Maybe a)
- ignoreIOError :: IO a -> IO (Maybe a)
- ignoreError :: Exception.Exception e => (e -> Bool) -> IO a -> IO (Maybe a)
- tryIO :: IO a -> IO (Either IO.Error.IOError a)
Documentation
ignoreEnoent_ :: IO a -> IO () Source #
ignoreIOError :: IO a -> IO (Maybe a) Source #
Ignore all IO errors. This is useful when you want to see if a file exists, because some-file/x will not give ENOENT, but ENOTDIR, which is probably isIllegalOperation.
ignoreError :: Exception.Exception e => (e -> Bool) -> IO a -> IO (Maybe a) Source #
tryIO :: IO a -> IO (Either IO.Error.IOError a) Source #
Exception.try
specialized to IOError.