Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell98 |
When you've caught all the exceptions that can be handled safely, this is what you're left with.
runEitherIO . fromIO ≡ id
- data UnexceptionalIO a
- type UIO = UnexceptionalIO
- fromIO :: IO a -> UnexceptionalIO (Either SomeException a)
- runUnexceptionalIO :: UnexceptionalIO a -> IO a
- runEitherIO :: Exception e => UnexceptionalIO (Either e a) -> IO a
- fromIO' :: Exception e => IO a -> UnexceptionalIO (Either e a)
- unsafeFromIO :: IO a -> UnexceptionalIO a
- syncIO :: IO a -> IO (Either SomeException a)
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
runUnexceptionalIO :: UnexceptionalIO a -> IO a Source
Re-embed UnexceptionalIO
into IO
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