Hoogle Search
Within LTS Haskell 24.32 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
onBimapFirst :: Bifunctor t => t a c -> (c -> d) -> (a -> b) -> t b doverhang Overhang Hang on the "left" mapping portion of a Bifunctor.
onBimapFirst t g f = bimap f g t
parallelFirst :: [IO (Maybe a)] -> IO (Maybe a)parallel-io Control.Concurrent.ParallelIO.Global Run the list of computations in parallel, returning the result of the first thread that completes with (Just x), if any. Users of the global pool must call stopGlobalPool from the main thread at the end of their program. See also parallelFirst.
parallelFirstE :: [IO (Maybe a)] -> IO (Maybe (Either SomeException a))parallel-io Control.Concurrent.ParallelIO.Global Run the list of computations in parallel, returning the result of the first thread that completes with (Just x), if any, and reporting any exception explicitly. Users of the global pool must call stopGlobalPool from the main thread at the end of their program. See also parallelFirstE.
parallelFirst :: Pool -> [IO (Maybe a)] -> IO (Maybe a)parallel-io Control.Concurrent.ParallelIO.Local Run the list of computations in parallel, returning the result of the first thread that completes with (Just x), if any Has the following properties:
- Never creates more or less unblocked threads than are specified to live in the pool. NB: this count includes the thread executing parallelInterleaved. This should minimize contention and hence pre-emption, while also preventing starvation.
- On return all actions have either been performed or cancelled (with ThreadKilled exceptions).
- The above properties are true even if parallelFirst is used by an action which is itself being executed by one of the parallel combinators.
- If any of the IO actions throws an exception, the exception thrown by the first throwing action in the input list will be thrown by parallelFirst. Importantly, at the time the exception is thrown there is no guarantee that the other parallel actions have been completed or cancelled.
- The main thread has used the parallel combinators to spawn two threads, thread 1 and thread 2. It is blocked on both of them waiting for them to return either a result or an exception via an MVar.
- Thread 1 and thread 2 share another (empty) MVar, the "wait handle". Thread 2 is waiting on the handle, while thread 1 will eventually put into the handle.
parallelFirstE :: Pool -> [IO (Maybe a)] -> IO (Maybe (Either SomeException a))parallel-io Control.Concurrent.ParallelIO.Local As parallelFirst, but instead of throwing exceptions that are thrown by subcomputations, they are returned in a data structure. As a result, property 4 of parallelFirst is not preserved, and therefore if your IO actions can depend on each other and may throw exceptions your program may die with "blocked indefinitely" exceptions rather than informative messages.
-
relational-schemas Database.Custom.IBMDB2 No documentation available.
-
relational-schemas Database.Custom.MySQL No documentation available.
-
relational-schemas Database.Custom.Oracle No documentation available.
-
relational-schemas Database.Custom.PostgreSQL No documentation available.
-
relational-schemas Database.Custom.SQLServer No documentation available.