Concurrency
Types
Handle to a spawned task.
TaskPending
Not yet started
TaskRunning
Currently executing
TaskCompleted
Finished successfully
TaskCancelled
Was cancelled
TaskFailed
Threw an exception
Status of a task.
Deadline timestamp.
Unbounded channel.
Bounded channel with capacity limit.
Mutable variable for synchronization.
Transactional variable.
Software transactional memory monad.
Counting semaphore.
Mutual exclusion lock.
Read-write lock.
Condition variable.
Barrier for synchronizing threads.
Single initialization.
Atomic integer.
Atomic reference.
Thread identifier.
Type Classes
Functions
Run action within a new scope.
Run action within a named scope (for debugging).
Cancel all tasks in scope.
Get scope name (if any).
Spawn a task within a scope.
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.
Get current deadline (if any).
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.
Create new channel.
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).
Create bounded channel.
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 MVar with initial value.
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 STM.
Create TVar in IO.
Read TVar in STM.
Read TVar in IO.
Write TVar in STM.
Modify TVar.
Modify TVar strictly.
Execute STM transaction atomically.
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.
Create semaphore with initial count.
Acquire permit (decrement, blocks if zero).
Release permit (increment).
Try to acquire (non-blocking).
Execute with acquired semaphore.
Create new mutex.
Acquire mutex lock.
Release mutex lock.
Try to acquire lock (non-blocking).
Execute with mutex locked.
Create new read-write lock.
Acquire read lock.
Release read lock.
Acquire write lock.
Release write lock.
Execute with read lock.
Execute with write lock.
Create new condition variable.
Wait on condition (must hold associated mutex).
Wait on condition with timeout.
Signal one waiting thread.
Signal all waiting threads.
Create barrier for n threads.
Wait at barrier.
Create new Once.
Run action at most once.
Create atomic integer.
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.
Create atomic reference.
Read atomic reference.
Write atomic reference.
Atomically modify reference.
Atomically modify reference strictly.
Compare and swap reference.
Get current thread ID.
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.