Sophie

Sophie

distrib > Mageia > 5 > i586 > media > core-release > by-pkgid > 6e204a966e8c42d976f99a1700ce5f20 > files > 2219

ghc-7.4.2-4.mga5.i586.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Control.Concurrent.SampleVar</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_Control-Concurrent-SampleVar.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">base-4.5.1.0: Basic libraries</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Portability</th><td>non-portable (concurrency)</td></tr><tr><th>Stability</th><td>experimental</td></tr><tr><th>Maintainer</th><td>libraries@haskell.org</td></tr><tr><th>Safe Haskell</th><td>Trustworthy</td></tr></table><p class="caption">Control.Concurrent.SampleVar</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Sample Variables
</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>Sample variables
</p></div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><span class="keyword">data</span>  <a href="#t:SampleVar">SampleVar</a> a</li><li class="src short"><a href="#v:newEmptySampleVar">newEmptySampleVar</a> ::  <a href="System-IO.html#t:IO">IO</a> (<a href="Control-Concurrent-SampleVar.html#t:SampleVar">SampleVar</a> a)</li><li class="src short"><a href="#v:newSampleVar">newSampleVar</a> ::  a -&gt; <a href="System-IO.html#t:IO">IO</a> (<a href="Control-Concurrent-SampleVar.html#t:SampleVar">SampleVar</a> a)</li><li class="src short"><a href="#v:emptySampleVar">emptySampleVar</a> ::  <a href="Control-Concurrent-SampleVar.html#t:SampleVar">SampleVar</a> a -&gt; <a href="System-IO.html#t:IO">IO</a> <a href="../ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:readSampleVar">readSampleVar</a> ::  <a href="Control-Concurrent-SampleVar.html#t:SampleVar">SampleVar</a> a -&gt; <a href="System-IO.html#t:IO">IO</a> a</li><li class="src short"><a href="#v:writeSampleVar">writeSampleVar</a> ::  <a href="Control-Concurrent-SampleVar.html#t:SampleVar">SampleVar</a> a -&gt; a -&gt; <a href="System-IO.html#t:IO">IO</a> <a href="../ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a></li><li class="src short"><a href="#v:isEmptySampleVar">isEmptySampleVar</a> ::  <a href="Control-Concurrent-SampleVar.html#t:SampleVar">SampleVar</a> a -&gt; <a href="System-IO.html#t:IO">IO</a> <a href="Data-Bool.html#t:Bool">Bool</a></li></ul></div><div id="interface"><h1 id="g:1">Sample Variables
</h1><div class="top"><p class="src"><span class="keyword">data</span>  <a name="t:SampleVar" class="def">SampleVar</a> a </p><div class="doc"><p>Sample variables are slightly different from a normal <code><a href="Control-Concurrent-MVar.html#t:MVar">MVar</a></code>:
</p><ul><li> Reading an empty <code><a href="Control-Concurrent-SampleVar.html#t:SampleVar">SampleVar</a></code> causes the reader to block.
    (same as <code><a href="Control-Concurrent-MVar.html#v:takeMVar">takeMVar</a></code> on empty <code><a href="Control-Concurrent-MVar.html#t:MVar">MVar</a></code>)
</li><li> Reading a filled <code><a href="Control-Concurrent-SampleVar.html#t:SampleVar">SampleVar</a></code> empties it and returns value.
    (same as <code><a href="Control-Concurrent-MVar.html#v:takeMVar">takeMVar</a></code>)
</li><li> Writing to an empty <code><a href="Control-Concurrent-SampleVar.html#t:SampleVar">SampleVar</a></code> fills it with a value, and
    potentially, wakes up a blocked reader (same as for <code><a href="Control-Concurrent-MVar.html#v:putMVar">putMVar</a></code> on
    empty <code><a href="Control-Concurrent-MVar.html#t:MVar">MVar</a></code>).
</li><li> Writing to a filled <code><a href="Control-Concurrent-SampleVar.html#t:SampleVar">SampleVar</a></code> overwrites the current value.
    (different from <code><a href="Control-Concurrent-MVar.html#v:putMVar">putMVar</a></code> on full <code><a href="Control-Concurrent-MVar.html#t:MVar">MVar</a></code>.)
</li></ul></div><div class="subs instances"><p id="control.i:SampleVar" class="caption collapser" onclick="toggleSection('i:SampleVar')">Instances</p><div id="section.i:SampleVar" class="show"><table><tr><td class="src"><a href="Data-Typeable-Internal.html#t:Typeable1">Typeable1</a> <a href="Control-Concurrent-SampleVar.html#t:SampleVar">SampleVar</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="Data-Eq.html#t:Eq">Eq</a> (<a href="Control-Concurrent-SampleVar.html#t:SampleVar">SampleVar</a> a)</td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:newEmptySampleVar" class="def">newEmptySampleVar</a> ::  <a href="System-IO.html#t:IO">IO</a> (<a href="Control-Concurrent-SampleVar.html#t:SampleVar">SampleVar</a> a)</p><div class="doc"><p>Build a new, empty, <code><a href="Control-Concurrent-SampleVar.html#t:SampleVar">SampleVar</a></code>
</p></div></div><div class="top"><p class="src"><a name="v:newSampleVar" class="def">newSampleVar</a> ::  a -&gt; <a href="System-IO.html#t:IO">IO</a> (<a href="Control-Concurrent-SampleVar.html#t:SampleVar">SampleVar</a> a)</p><div class="doc"><p>Build a <code><a href="Control-Concurrent-SampleVar.html#t:SampleVar">SampleVar</a></code> with an initial value.
</p></div></div><div class="top"><p class="src"><a name="v:emptySampleVar" class="def">emptySampleVar</a> ::  <a href="Control-Concurrent-SampleVar.html#t:SampleVar">SampleVar</a> a -&gt; <a href="System-IO.html#t:IO">IO</a> <a href="../ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a></p><div class="doc"><p>If the SampleVar is full, leave it empty.  Otherwise, do nothing.
</p></div></div><div class="top"><p class="src"><a name="v:readSampleVar" class="def">readSampleVar</a> ::  <a href="Control-Concurrent-SampleVar.html#t:SampleVar">SampleVar</a> a -&gt; <a href="System-IO.html#t:IO">IO</a> a</p><div class="doc"><p>Wait for a value to become available, then take it and return.
</p></div></div><div class="top"><p class="src"><a name="v:writeSampleVar" class="def">writeSampleVar</a> ::  <a href="Control-Concurrent-SampleVar.html#t:SampleVar">SampleVar</a> a -&gt; a -&gt; <a href="System-IO.html#t:IO">IO</a> <a href="../ghc-prim-0.2.0.0/GHC-Tuple.html#t:-40--41-">()</a></p><div class="doc"><p>Write a value into the <code><a href="Control-Concurrent-SampleVar.html#t:SampleVar">SampleVar</a></code>, overwriting any previous value that
 was there.
</p></div></div><div class="top"><p class="src"><a name="v:isEmptySampleVar" class="def">isEmptySampleVar</a> ::  <a href="Control-Concurrent-SampleVar.html#t:SampleVar">SampleVar</a> a -&gt; <a href="System-IO.html#t:IO">IO</a> <a href="Data-Bool.html#t:Bool">Bool</a></p><div class="doc"><p>Returns <code><a href="Data-Bool.html#v:True">True</a></code> if the <code><a href="Control-Concurrent-SampleVar.html#t:SampleVar">SampleVar</a></code> is currently empty.
</p><p>Note that this function is only useful if you know that no other
 threads can be modifying the state of the <code><a href="Control-Concurrent-SampleVar.html#t:SampleVar">SampleVar</a></code>, because
 otherwise the state of the <code><a href="Control-Concurrent-SampleVar.html#t:SampleVar">SampleVar</a></code> may have changed by the time
 you see the result of <code><a href="Control-Concurrent-SampleVar.html#v:isEmptySampleVar">isEmptySampleVar</a></code>.
</p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.11.0</p></div></body></html>