Module

Control.Monad.AvarMonadAsk

#get

get :: forall s m. MonadAff m => MonadAsk (AVar s) m => m s

Returns the state. Blocks as long as the AVar is empty. Does not block a filled AVar: it is not left empty. Compares with StateT get.

#gets

gets :: forall s m a. MonadAff m => MonadAsk (AVar s) m => (s -> a) -> m a

Returns the result of applying a function to the state. Compares with StateT gets.

#put

put :: forall s m. MonadAff m => MonadAsk (AVar s) m => s -> m Unit

Puts a new state in the AVar holding the state. Uses replaceAVarContent: so blocks as long as the AVar passed in is empty. Compares with StateT put.

#modify

modify :: forall s m. MonadAff m => MonadAsk (AVar s) m => (s -> s) -> m Unit

Replace the content of the AVar holding the state, with the result of applying a function to its contents. Blocks as long as the AVar is empty; blocks while the content is modified. Compares with StateT modify.

Modules