Copyright | © 2018-2020 IOHK |
---|---|
License | Apache-2.0 |
Safe Haskell | None |
Language | Haskell2010 |
Extra glue functions to work with
MonadUnliftIO
exception types. We need
this because the
retry
package uses the generalized exception handler type
from
Handler
. But the
Exceptions
module has
its own definition of exactly the same type.
Synopsis
- coerceHandler :: Handler IO b -> Handler IO b
- coerceHandlers :: [a -> Handler IO b] -> [a -> Handler IO b]
- mkRetryHandler :: Exception e => (e -> m Bool ) -> [a -> Handler m Bool ]
- handleIf :: ( MonadUnliftIO m, Exception e) => (e -> Bool ) -> (e -> m a) -> m a -> m a
- data AsyncCancelled = AsyncCancelled
Handler conversion
coerceHandlers :: [a -> Handler IO b] -> [a -> Handler IO b] Source #
Convert a list of handler factories from the
Exception
type to
Catch
type. Such handlers are used in
Recovering
for example.
mkRetryHandler :: Exception e => (e -> m Bool ) -> [a -> Handler m Bool ] Source #
Shortcut for creating a single
Retry
handler, which doesn't use
the
RetryStatus
info.
Missing combinators
handleIf :: ( MonadUnliftIO m, Exception e) => (e -> Bool ) -> (e -> m a) -> m a -> m a Source #
A
MonadUnliftIO
version of
handleIf
.
Re-export unsafe things
data AsyncCancelled Source #
The exception thrown by
cancel
to terminate a thread.
Instances
Eq AsyncCancelled | |
Defined in Control.Concurrent.Async (==) :: AsyncCancelled -> AsyncCancelled -> Bool Source # (/=) :: AsyncCancelled -> AsyncCancelled -> Bool Source # |
|
Show AsyncCancelled | |
Defined in Control.Concurrent.Async |
|
Exception AsyncCancelled | |
Defined in Control.Concurrent.Async |