unix-bytestring-0.3.5.4: Unix/Posix-specific functions for ByteStrings.

Portabilityportable (H98+FFI)
Stabilityprovisional
Maintainerwren@community.haskell.org
Safe HaskellSafe-Infered

Foreign.C.Error.Safe

Contents

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

eitherErrnoIfSource

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.

eitherErrnoIfRetrySource

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.

eitherErrnoIfRetryMayBlockSource

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 ==)