A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://hackage.haskell.org/packages/archive/base/4.6.0.0/doc/html/Control-Concurrent-SampleVar.html below:

Control.Concurrent.SampleVar

Sample Variables

data SampleVar a Source

Sample variables are slightly different from a normal MVar:

Instances

Typeable1 SampleVar   Eq (SampleVar a)  

newEmptySampleVar :: IO (SampleVar a)Source

Build a new, empty, SampleVar

newSampleVar :: a -> IO (SampleVar a)Source

Build a SampleVar with an initial value.

emptySampleVar :: SampleVar a -> IO ()Source

If the SampleVar is full, leave it empty. Otherwise, do nothing.

readSampleVar :: SampleVar a -> IO aSource

Wait for a value to become available, then take it and return.

writeSampleVar :: SampleVar a -> a -> IO ()Source

Write a value into the SampleVar, overwriting any previous value that was there.

isEmptySampleVar :: SampleVar a -> IO BoolSource

Returns True if the SampleVar is currently empty.

Note that this function is only useful if you know that no other threads can be modifying the state of the SampleVar, because otherwise the state of the SampleVar may have changed by the time you see the result of isEmptySampleVar.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4