unamb-0.0.1: Unambiguous choice

Stabilityexperimental
Maintainerconal@conal.net

Data.Unamb

Description

Unambiguous choice

Synopsis

Documentation

unamb :: a -> a -> aSource

Unambiguous choice operator. Equivalent to the ambiguous choice operator, but with arguments restricted to be equal where not bottom, so that the choice doesn't matter. See also amb.

amb :: a -> a -> IO aSource

Ambiguous choice operator. Yield either value. Evaluates in separate threads and picks whichever finishes first. See also unamb and race.

race :: IO a -> IO a -> IO aSource

Race two actions against each other in separate threads, and pick whichever finishes first. See also amb. Thanks to Spencer Janssen for this simple version.

assuming :: Bool -> a -> aSource

Yield a value if a condition is true. Otherwise wait forever.

hang :: aSource

Never yield an answer. Like undefined or 'error whatever', but don't raise an error, and don't consume computational resources.

asAgree :: Eq a => a -> a -> aSource

The value of agreeing values (or hang)