IOError
type has therefore been
extended from Haskell 1.2, and possible error values have been
identified for all standard operations.
> interface PreludeIOError where
> data IOError = AlreadyExists String > | HardwareFault String > | IllegalOperation String > | InappropriateType String > | Interrupted String > | InvalidArgument String > | NoSuchThing String > | OtherError String > | PermissionDenied String > | ProtocolError String > | ResourceBusy String > | ResourceExhausted String > | ResourceVanished String > | SystemError String > | TimeExpired String > | UnsatisfiedConstraints String > | UnsupportedOperation String > | UserError String > | EOF
> instance Text IOError where > showsPrec _ e s = ...
SystemError
is reserved for the low-level operating system
interface routines, such as those defined in LibPOSIX
, and should not be returned
by the high-level routines in the Prelude.
The String
part of an IOError
is
platform-dependent. However, to provide a uniform mechanism for
distinguishing among errors within these broad categories, each
platform-specific standard shall specify the exact strings to be used
for particular errors. For errors not explicitly mentioned in the
standard, any descriptive string may be used.