HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

Modulelifted-async-0.11.0Haskell2010

Control.Concurrent.Async.Lifted.Safe

This is a safe variant of Control.Concurrent.Async.Lifted.

This module assumes your monad stack to satisfy StM m a ~ a so you can't mess up monadic effects. If your monad stack is stateful, use Control.Concurrent.Async.Lifted with special care.

Contents
  1. Asynchronous actions
  2. Spawning
  3. Spawning with automatic cancelation
  4. Quering Asyncs
  5. STM operations
  6. Waiting for multiple Asyncs
  7. Waiting for multiple Asyncs in STM
  8. Linking
  9. Convenient utilities
Synopsis

Asynchronous actions

datadata Async a

An asynchronous action spawned by async or withAsync. Asynchronous actions are executed in a separate thread, and operations are provided for waiting for asynchronous actions to complete and obtaining their results (see e.g. wait).

Instances4Functor, Eq, Ord, Hashable
  • Functor AsyncDefined in async-2.2.6 · Control.Concurrent.Async.Internal
  • Eq (Async a)Defined in async-2.2.6 · Control.Concurrent.Async.Internal
  • Ord (Async a)Defined in async-2.2.6 · Control.Concurrent.Async.Internal
  • Hashable (Async a)Defined in async-2.2.6 · Control.Concurrent.Async.Internal
classclass StM m a ~ a => Pure (m :: Type -> Type) a

Most of the functions in this module have Forall (Pure m) in their constraints, which means they require the monad m satisfies StM m a ~ a for all a.

Instances1Pure
  • StM m a ~ a => Pure m aDefined in lifted-async-0.11.0 · Control.Concurrent.Async.Lifted.Safe
classclass (forall (a :: k). p a) => Forall (p :: k -> Constraint)
#
Instances1Forall
  • (forall (a :: k). p a) => Forall pDefined in constraints-0.14.4 · Data.Constraint.Forall

Spawning

Spawning with automatic cancelation

Quering Asyncs

STM operations

Waiting for multiple Asyncs

Waiting for multiple Asyncs in STM

Linking

Convenient utilities

datadata Concurrently (m :: Type -> Type) a where

Generalized version of Concurrently.

A value of type Concurrently m a is an IO-based operation that can be composed with other Concurrently values, using the Applicative and Alternative instances.

Calling runConcurrently on a value of type Concurrently m a will execute the IO-based lifted operations it contains concurrently, before delivering the result of type a.

For example

  (page1, page2, page3) <- runConcurrently $ (,,)
    <$> Concurrently (getURL "url1")
    <*> Concurrently (getURL "url2")
    <*> Concurrently (getURL "url3")

Constructors

Instances5Functor, Applicative, Alternative, Semigroup, Monoid