io-choice-0.0.5: Choice for IO and lifted IO

Safe Haskell | Safe
Language | Haskell98

Control.Exception.IOChoice.Lifted

Description

This package provides the choice operator (`||>`) for lifted IO monad.

Synopsis

- (||>) :: MonadBaseControl IO m => m a -> m a -> m a
- goNext :: (MonadIO m, MonadBase IO m) => m a
- runAnyOne :: (MonadIO m, MonadBaseControl IO m) => [m a] -> m a

# Documentation

(||>) :: MonadBaseControl IO m => m a -> m a -> m a infixr 3 Source

If `IOException` occurs or `goNext` is used in the left monad, then the right monad is performed. Note that `fail` throws `IOException`.

goNext :: (MonadIO m, MonadBase IO m) => m a Source

Go to the next `IO` monad by throwing `IOException`.

runAnyOne :: (MonadIO m, MonadBaseControl IO m) => [m a] -> m a Source

Run any one lifted `IO` monad.