haxl-2.4.0.0: A Haskell library for efficient, concurrent, and concise data access.
Safe HaskellNone
LanguageHaskell2010

Haxl.Core.Parallel

Description

Psuedo-parallel operations. Most users should import Haxl.Core instead.

Synopsis

Parallel operations

biselect :: GenHaxl u w (Either a b) -> GenHaxl u w (Either a c) -> GenHaxl u w (Either a (b, c)) Source #

pAnd :: GenHaxl u w Bool -> GenHaxl u w Bool -> GenHaxl u w Bool infixr 5 Source #

Parallel version of (.&&). Both arguments are evaluated in parallel, and if either returns False then the other is not evaluated any further.

WARNING: exceptions may be unpredictable when using pAnd. If one argument returns False before the other completes, then pAnd returns False immediately, ignoring a possible exception that the other argument may have produced if it had been allowed to complete.

pOr :: GenHaxl u w Bool -> GenHaxl u w Bool -> GenHaxl u w Bool infixr 4 Source #

Parallel version of (.||). Both arguments are evaluated in parallel, and if either returns True then the other is not evaluated any further.

WARNING: exceptions may be unpredictable when using pOr. If one argument returns True before the other completes, then pOr returns True immediately, ignoring a possible exception that the other argument may have produced if it had been allowed to complete.

unsafeChooseFirst :: GenHaxl u w a -> GenHaxl u w b -> GenHaxl u w (Either a b) Source #

This function takes two haxl computations as input, and returns the output of whichever computation finished first. This is clearly non-deterministic in its output and exception behavior, be careful when using it.