| Copyright | 2010--2022 wren romano |
|---|---|
| License | BSD-3-Clause |
| Maintainer | [email protected] |
| Stability | provisional |
| Portability | portable (H98+FFI) |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Foreign.C.Error.Safe
Description
Provides a variant of the Foreign.C.Error API which returns errors explicitly, instead of throwing exceptions.
Since: 0.3.5
Synopsis
- eitherErrnoIf :: (a -> Bool) -> IO a -> IO (Either Errno a)
- eitherErrnoIfRetry :: (a -> Bool) -> IO a -> IO (Either Errno a)
- eitherErrnoIfRetryMayBlock :: (a -> Bool) -> IO a -> IO b -> IO (Either Errno a)
- eitherErrnoIfMinus1 :: (Eq a, Num a) => IO a -> IO (Either Errno a)
- eitherErrnoIfMinus1Retry :: (Eq a, Num a) => IO a -> IO (Either Errno a)
- eitherErrnoIfMinus1RetryMayBlock :: (Eq a, Num a) => IO a -> IO b -> IO (Either Errno a)
- eitherErrnoIfNull :: IO (Ptr a) -> IO (Either Errno (Ptr a))
- eitherErrnoIfNullRetry :: IO (Ptr a) -> IO (Either Errno (Ptr a))
- eitherErrnoIfNullRetryMayBlock :: IO (Ptr a) -> IO b -> IO (Either Errno (Ptr a))
Primitive handlers
Arguments
| :: (a -> Bool) | Predicate to apply to the result value of
the |
| -> IO a | The |
| -> IO (Either Errno a) |
A variant of throwErrnoIf which returns Either instead
of throwing an errno error.
Arguments
| :: (a -> Bool) | Predicate to apply to the result value of
the |
| -> IO a | The |
| -> IO (Either Errno a) |
A variant of throwErrnoIfRetry which returns Either
instead of throwing an errno error.
eitherErrnoIfRetryMayBlock Source #
Arguments
| :: (a -> Bool) | Predicate to apply to the result value of
the |
| -> IO a | The |
| -> IO b | Action to execute before retrying if an immediate retry would block. |
| -> IO (Either Errno a) |
A variant of throwErrnoIfRetryMayBlock which returns
Either instead of throwing an errno error.