skip-var-0.1.0.0: Skip variables

Copyright(c) 2018 Daniel Taskoff
LicenseMIT
Maintainerdaniel.taskoff@gmail.com, godzbanebane@gmail.com
Stabilityexperimental
Safe HaskellSafe
LanguageHaskell2010

Control.Concurrent.SVar

Contents

Description

 
Synopsis

SVar

data SVar a Source #

An SVar (skip variable) is a variable which allows for non-blocking updates, and blocking reads if the stored data has been read already, or if there is no data.

Creation of SVars

newEmptySVar :: IO (SVar a) Source #

Create an empty SVar.

newSVar :: a -> IO (SVar a) Source #

Create an SVar which contains the supplied value.

Modification of SVars

putSVar :: SVar a -> a -> IO () Source #

Put a value into an SVar. Never blocks, always overwrites the current value, if there is one.

readSVar :: SVar a -> IO a Source #

Read a value from an SVar. Blocks if there isn't a new value since the last read, or if the SVar is empty.