unexceptionalio-0.2.0: IO without any non-error, synchronous exceptions

Safe HaskellSafe-Inferred
LanguageHaskell98

UnexceptionalIO

Contents

Description

When you've caught all the exceptions that can be handled safely, this is what you're left with.

runEitherIO . fromIO ≡ id

Synopsis

Documentation

data UnexceptionalIO a Source

IO without any non-error, synchronous exceptions

type UIO = UnexceptionalIO Source

or, you may prefer a short name

fromIO :: IO a -> UnexceptionalIO (Either SomeException a) Source

Catch any non-error, synchronous exceptions in an IO action

runEitherIO :: Exception e => UnexceptionalIO (Either e a) -> IO a Source

Re-embed UnexceptionalIO and possible exception back into IO

Unsafe entry points

fromIO' :: Exception e => IO a -> UnexceptionalIO (Either e a) Source

You promise that e covers all non-error, synchronous exceptions thrown by this IO action

This function is partial if you lie

unsafeFromIO :: IO a -> UnexceptionalIO a Source

You promise there are no exceptions thrown by this IO action

Utilities

syncIO :: IO a -> IO (Either SomeException a) Source

Catch all exceptions, except for asynchronous exceptions found in base