Concurrency
Types
TaskPending
Not yet started
TaskRunning
Currently executing
TaskCompleted
Finished successfully
TaskCancelled
Was cancelled
TaskFailed
Threw an exception
Status of a task.
Type Classes
Functions
Run action within a named scope (for debugging).
Cancel all tasks in scope.
Get scope name (if any).
Spawn a named task.
Wait for task completion.
Wait for all tasks.
Check if task completed (non-blocking).
Cancel a task.
Get task identifier.
Get current task status.
Check if task is running.
Check if task completed successfully.
Check if task was cancelled.
Check if task failed with exception.
Check if current task is cancelled.
Run action with cancellation support.
Register cleanup handler for cancellation.
Check if exception is cancellation.
Run action with deadline.
Run action with timeout.
Time remaining until deadline.
Spawn async computation.
Spawn named async computation.
Wait for async result.
Wait for async result, catching exceptions.
Wait for any task to complete.
Wait for all tasks to complete.
Wait for either task to complete.
Race two actions, cancel loser.
Race two actions, discard result.
Run two actions concurrently.
Run two actions concurrently, discard results.
Map function over list concurrently.
Map function over list concurrently, discard results.
Flipped mapConcurrently.
Flipped mapConcurrently_.
Replicate action concurrently.
Replicate action concurrently, discard results.
Read from channel (blocks if empty).
Write to channel.
Try to read (non-blocking).
Try to write (non-blocking).
Check if channel is empty.
Duplicate channel (new read end).
Read from bounded channel.
Write to bounded channel (blocks if full).
Try to read from bounded channel.
Try to write to bounded channel.
Check if channel is at capacity.
Get channel capacity.
Create empty MVar.
Take value from MVar (blocks if empty).
Put value into MVar (blocks if full).
Read MVar without taking.
Try to take (non-blocking).
Try to put (non-blocking).
Try to read (non-blocking).
Check if MVar is empty.
Modify MVar contents atomically.
Modify MVar contents atomically (no result).
Execute action with MVar value.
Swap MVar contents.
Create TVar in IO.
Read TVar in STM.
Read TVar in IO.
Write TVar in STM.
Modify TVar.
Modify TVar strictly.
Retry transaction (block until TVars change).
Try first, then second if first retries.
Retry if condition is false.
Throw exception in STM.
Catch exception in STM.
Acquire permit (decrement, blocks if zero).
Release permit (increment).
Try to acquire (non-blocking).
Execute with acquired semaphore.
Acquire mutex lock.
Release mutex lock.
Try to acquire lock (non-blocking).
Execute with mutex locked.
Acquire read lock.
Release read lock.
Acquire write lock.
Release write lock.
Execute with read lock.
Execute with write lock.
Wait on condition (must hold associated mutex).
Wait on condition with timeout.
Signal one waiting thread.
Signal all waiting threads.
Wait at barrier.
Run action at most once.
Read atomic integer.
Write atomic integer.
Atomic add, returns old value.
Atomic subtract, returns old value.
Atomic bitwise and, returns old value.
Atomic bitwise or, returns old value.
Atomic bitwise xor, returns old value.
Compare and swap, returns success.
Read atomic reference.
Write atomic reference.
Atomically modify reference.
Atomically modify reference strictly.
Compare and swap reference.
Fork new thread.
Fork bound thread.
Fork on specific capability.
Fork with cleanup handler.
Kill thread with async exception.
Yield to scheduler.
Delay for microseconds.
Get thread's capability.
Set number of capabilities.
Get number of capabilities.
Get number of processors.
Check if current thread is bound.
Run in bound thread.
Run in unbound thread.
Mask async exceptions.
Mask async exceptions (no restore).
Mask async exceptions uninterruptibly.
Mask async exceptions uninterruptibly (no restore).
Acquire/release pattern.
Bracket without resource.
Bracket with cleanup only on error.
Run action with cleanup.
Run cleanup on exception.
Spark parallel evaluation.
Parallel sequence.
Parallel map.
Parallel list evaluation.
Parallel buffer.
Parallel chunked list.
Evaluate to WHNF strategy.
Spark parallel evaluation strategy.
Evaluate to NF strategy.
Apply strategy to value.
Apply strategy in context.
Run evaluation.