cafeteria-prelude-0.1.0.0: Prelude subsets—take only what you want!

Safe HaskellSafe-Inferred
LanguageHaskell2010

Prelude.Error.IO

Synopsis

Documentation

type IOError = IOException

The Haskell 2010 type for exceptions in the IO monad. Any I/O operation may raise an IOError instead of returning a result. For a more general type of exception, including also those that arise in pure code, see Control.Exception.Exception.

In Haskell 2010, this is an opaque type.

ioError :: IOError -> IO a

Raise an IOError in the IO monad.

userError :: String -> IOError

Construct an IOError value with a string describing the error. The fail method of the IO instance of the Monad class raises a userError, thus:

instance Monad IO where
  ...
  fail s = ioError (userError s)