Idris2Doc : IO.Async.MVar

IO.Async.MVar

(source)

Definitions

record MVar : Type -> Type
  A thread-safe mutable variable.

This comes with several atomic operations: `readMVar`,
`writeMVar`, `modifyMVar`, and `evalState`.

"Atomic" in this context means, that during such an operation,
no other thread will be able to access the mutable variable.

This uses a `System.Concurrency.Mutex` internally, so it will only
be available on the Scheme backends.

Totality: total
Visibility: export
Constructor: 
MV : IORef a -> Mutex -> MVar a

Projections:
.lock : MVar a -> Mutex
.ref : MVar a -> IORef a
newMVar : a -> IO (MVar a)
  Create a new mutable variable.

Totality: total
Visibility: export
readMVar : MVar a -> IO a
  Atomically read the value from a mutable variable.

Totality: total
Visibility: export
writeMVar : MVar a -> a -> IO ()
  Atomically write a value into a mutable variable.

Totality: total
Visibility: export
modifyMVar : MVar a -> (a -> a) -> IO ()
  Atomically modify the value in a mutable variable.

Totality: total
Visibility: export
evalState : MVar a -> (a -> (a, b)) -> IO b
  Atomically modify and extract the value from a
mutable variable.

Totality: total
Visibility: export
record MQueue : Type -> Type
Totality: total
Visibility: export
Constructor: 
MQ : MVar (Queue a) -> MQueue a

Projection: 
.var : MQueue a -> MVar (Queue a)
newMQueue : IO (MQueue a)
Totality: total
Visibility: export
enqueue : MQueue a -> a -> IO ()
Totality: total
Visibility: export
dequeue : MQueue a -> IO (Maybe a)
Totality: total
Visibility: export