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

Safe Haskell | Safe
Language | Haskell98

UnexceptionalIO

Contents

- Unsafe entry points
- Utilities

Description

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

    runEitherIO . fromIO ≡ id

Synopsis

- data UIO a
- class Unexceptional m where
- fromIO :: IO a -> UIO (Either SomeException a)
- runUIO :: UIO a -> IO a
- runEitherIO :: Exception e => UIO (Either e a) -> IO a
- fromIO' :: Exception e => IO a -> UIO (Either e a)
- unsafeFromIO :: IO a -> UIO a
- syncIO :: IO a -> IO (Either SomeException a)

# Documentation

data UIO a Source #

IO without any non-error, synchronous exceptions

Instances

Monad UIO Source # |
Methods (>>=) :: UIO a -> (a -> UIO b) -> UIO b # (>>) :: UIO a -> UIO b -> UIO b # return :: a -> UIO a # fail :: String -> UIO a #
Functor UIO Source # |
Methods fmap :: (a -> b) -> UIO a -> UIO b # (<$) :: a -> UIO b -> UIO a #
MonadFix UIO Source # |
Methods mfix :: (a -> UIO a) -> UIO a #
Applicative UIO Source # |
Methods pure :: a -> UIO a # (<*>) :: UIO (a -> b) -> UIO a -> UIO b # (*>) :: UIO a -> UIO b -> UIO b # (<*) :: UIO a -> UIO b -> UIO a #
Unexceptional UIO Source # |
Methods liftUIO :: UIO a -> UIO a Source #

class Unexceptional m where Source #

Polymorphic base without any non-error, synchronous exceptions

Minimal complete definition

liftUIO

Methods

liftUIO :: UIO a -> m a Source #

Instances

Unexceptional IO Source # |
Methods liftUIO :: UIO a -> IO a Source #
Unexceptional UIO Source # |
Methods liftUIO :: UIO a -> UIO 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`