unix-bytestring-0.4.0.1: Unix/Posix-specific functions for ByteStrings.
Copyright2010--2022 wren romano
LicenseBSD-3-Clause
Maintainerwren@cpan.org
Stabilityprovisional
Portabilityportable (H98+FFI)
Safe HaskellSafe-Inferred
LanguageHaskell2010

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

Primitive handlers

eitherErrnoIf Source #

Arguments

:: (a -> Bool)

Predicate to apply to the result value of the IO operation.

-> IO a

The IO operation to be executed.

-> IO (Either Errno a) 

A variant of throwErrnoIf which returns Either instead of throwing an errno error.

eitherErrnoIfRetry Source #

Arguments

:: (a -> Bool)

Predicate to apply to the result value of the IO operation.

-> IO a

The IO operation to be executed.

-> 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 operation.

-> IO a

The IO operation to be executed.

-> 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.

Derived handlers

With predicate (-1 ==)

With predicate (nullPtr ==)