prologue-3.2.6: Better, more general Prelude exporting common utilities.

Safe HaskellNone
LanguageHaskell2010

Prologue.Control.Monad.IO

Synopsis

Documentation

putChar :: MonadIO m => Char -> m () Source #

putStr :: MonadIO m => String -> m () Source #

putStrLn :: MonadIO m => String -> m () Source #

print :: (MonadIO m, Show a) => a -> m () Source #

pprint :: (MonadIO m, Show a) => a -> m () Source #

interact :: MonadIO m => (String -> String) -> m () Source #

ioError :: MonadIO m => IOError -> m a Source #

type FilePath = String #

File and directory names are values of type String, whose precise meaning is operating system dependent. Files can be opened, yielding a handle which can then be used to operate on the contents of that file.

userError :: String -> IOError #

Construct an IOException 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)

type IOError = IOException #

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

In Haskell 2010, this is an opaque type.