HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

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.

  • 4 types
  • 2 classes
  • 49 values

Asynchronous actions

3 declarations
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.5 · Control.Concurrent.Async.Internal
  • Eq (Async a)Defined in async-2.2.5 · Control.Concurrent.Async.Internal
  • Ord (Async a)Defined in async-2.2.5 · Control.Concurrent.Async.Internal
  • Hashable (Async a)Defined in async-2.2.5 · 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.2 · 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

12 declarations
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