Module

Control.Monad.Aff.AVar

Package
purescript-aff
Repository
slamdata/purescript-aff

A low-level primitive for building asynchronous code.

#AVAR Source

data AVAR :: Effect

#AffAVar Source

type AffAVar e a = Aff (avar :: AVAR | e) a

#makeVar Source

makeVar :: forall a e. AffAVar e (AVar a)

Makes a new asynchronous avar.

#makeVar' Source

makeVar' :: forall a e. a -> AffAVar e (AVar a)

Makes a avar and sets it to some value.

#takeVar Source

takeVar :: forall a e. AVar a -> AffAVar e a

Takes the next value from the asynchronous avar.

#peekVar Source

peekVar :: forall a e. AVar a -> AffAVar e a

Reads a value from the asynchronous var but does not consume it.

#putVar Source

putVar :: forall a e. AVar a -> a -> AffAVar e Unit

Puts a new value into the asynchronous avar. If the avar has been killed, this will result in an error.

#modifyVar Source

modifyVar :: forall a e. (a -> a) -> AVar a -> AffAVar e Unit

Modifies the value at the head of the avar (will suspend until one is available).

#killVar Source

killVar :: forall a e. AVar a -> Error -> AffAVar e Unit

Kills an asynchronous avar.

Re-exports from Control.Monad.Aff.Internal

#AVar Source

data AVar :: Type -> Type