Haskell Core Libraries (base package)ParentContentsIndex
System.IO.Error
Portability portable
Stability provisional
Maintainer libraries@haskell.org
Description
Standard IO Errors.
Synopsis
type IOError = Exception
data IOErrorType
ioError :: Exception -> IO a
userError :: String -> IOError
mkIOError :: IOErrorType -> String -> Maybe Handle -> Maybe FilePath -> IOError
alreadyExistsErrorType :: IOErrorType
doesNotExistErrorType :: IOErrorType
alreadyInUseErrorType :: IOErrorType
fullErrorType :: IOErrorType
eofErrorType :: IOErrorType
illegalOperationErrorType :: IOErrorType
permissionErrorType :: IOErrorType
userErrorType :: IOErrorType
isAlreadyExistsErrorType :: IOErrorType -> Bool
isDoesNotExistErrorType :: IOErrorType -> Bool
isAlreadyInUseErrorType :: IOErrorType -> Bool
isFullErrorType :: IOErrorType -> Bool
isEOFErrorType :: IOErrorType -> Bool
isIllegalOperationErrorType :: IOErrorType -> Bool
isPermissionErrorType :: IOErrorType -> Bool
isUserErrorType :: IOErrorType -> Bool
isAlreadyExistsError :: IOError -> Bool
isDoesNotExistError :: IOError -> Bool
isAlreadyInUseError :: IOError -> Bool
isFullError :: IOError -> Bool
isEOFError :: IOError -> Bool
isIllegalOperation :: IOError -> Bool
isPermissionError :: IOError -> Bool
isUserError :: IOError -> Bool
ioeGetErrorType :: IOError -> IOErrorType
ioeGetErrorString :: IOError -> String
ioeGetHandle :: IOError -> Maybe Handle
ioeGetFileName :: IOError -> Maybe FilePath
Documentation
type IOError = Exception
data IOErrorType
Instances
Eq IOErrorType
Show IOErrorType
ioError :: Exception -> IO a

A variant of throw that can be used within the IO monad.

Although ioError has a type that is an instance of the type of throw, the two functions are subtly different:

 throw e   `seq` return ()  ===> throw e
 ioError e `seq` return ()  ===> return ()

The first example will cause the exception e to be raised, whereas the second one won't. In fact, ioError will only cause an exception to be raised when it is used within the IO monad. The ioError variant should be used in preference to throw to raise an exception within the IO monad because it guarantees ordering with respect to other IO operations, whereas throw does not.

userError :: String -> IOError
mkIOError :: IOErrorType -> String -> Maybe Handle -> Maybe FilePath -> IOError
alreadyExistsErrorType :: IOErrorType
doesNotExistErrorType :: IOErrorType
alreadyInUseErrorType :: IOErrorType
fullErrorType :: IOErrorType
eofErrorType :: IOErrorType
illegalOperationErrorType :: IOErrorType
permissionErrorType :: IOErrorType
userErrorType :: IOErrorType
isAlreadyExistsErrorType :: IOErrorType -> Bool
isDoesNotExistErrorType :: IOErrorType -> Bool
isAlreadyInUseErrorType :: IOErrorType -> Bool
isFullErrorType :: IOErrorType -> Bool
isEOFErrorType :: IOErrorType -> Bool
isIllegalOperationErrorType :: IOErrorType -> Bool
isPermissionErrorType :: IOErrorType -> Bool
isUserErrorType :: IOErrorType -> Bool
isAlreadyExistsError :: IOError -> Bool
isDoesNotExistError :: IOError -> Bool
isAlreadyInUseError :: IOError -> Bool
isFullError :: IOError -> Bool
isEOFError :: IOError -> Bool
isIllegalOperation :: IOError -> Bool
isPermissionError :: IOError -> Bool
isUserError :: IOError -> Bool
ioeGetErrorType :: IOError -> IOErrorType
ioeGetErrorString :: IOError -> String
ioeGetHandle :: IOError -> Maybe Handle
ioeGetFileName :: IOError -> Maybe FilePath
Produced by Haddock version 0.4