HORIZON HASKELLDocslts/ghc-10.0.xaa25b892026-10-10Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · aa25b89 · 2026-10-10

Moduleasync-2.2.6Haskell2010

Control.Concurrent.Stream

Processing streams with a fixed number of worker threads

  • 7 values
  • Packageasync-2.2.6
  • Exports7
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceStream.hs
valuestream
  1. :: Int

    Maximum Concurrency

  2. -> ((a -> IO ()) -> IO ())

    Producer

  3. -> (a -> IO ())

    Worker

  4. -> IO ()
#

Maps a fixed number of workers concurrently over a stream of values produced by a producer function. The producer is passed a function to call for each work item. If a worker throws a synchronous exception, it will be propagated to the caller.

valuestreamBound
  1. :: Int

    Maximum Concurrency

  2. -> ((a -> IO ()) -> IO ())

    Producer

  3. -> (a -> IO ())

    Worker

  4. -> IO ()
#

Like stream, but uses bound threads for the workers. See forkOS for details on bound threads.

valuestreamWithInput
  1. :: ((a -> IO ()) -> IO ())

    Producer

  2. -> [b]

    Worker state

  3. -> (b -> a -> IO ())

    Worker

  4. -> IO ()
#

Like stream, but each worker is passed an element of an input list.

valuemapConcurrentlyBounded
  1. :: Int

    Maximum concurrency

  2. -> (a -> IO b)

    Function to map over the input values

  3. -> [a]

    List of input values

  4. -> IO [b]

    List of output values

#

Concurrent map over a list of values, using a bounded number of threads.