cardano-wallet-core-2022.7.1: The Wallet Backend for a Cardano node.
Copyright © 2018-2020 IOHK
License Apache-2.0
Safe Haskell None
Language Haskell2010

UnliftIO.Compat

Description

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

Handler conversion

coerceHandler :: Handler IO b -> Handler IO b Source #

Convert the generalized handler from Exception type to Catch type

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 #

Re-export unsafe things