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

Safe HaskellSafe
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 UIO a Source

IO without any non-error, synchronous exceptions

class Unexceptional m where Source

Polymorphic base without any non-error, synchronous exceptions

Methods

liftUIO :: UIO a -> m a Source

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

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

runUIO :: UIO a -> IO a Source

Re-embed UIO into IO

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

Re-embed UIO and possible exception back into IO

Unsafe entry points

fromIO' :: Exception e => IO a -> UIO (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 -> UIO 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