This file is indexed.

/usr/share/doc/libghc-stm-chans-doc/html/Control-Concurrent-STM-TBMChan.html is in libghc-stm-chans-doc 3.0.0.4-5build1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<!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.STM.TBMChan</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script src="file:///usr/share/javascript/mathjax/MathJax.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_Control-Concurrent-STM-TBMChan.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Control-Concurrent-STM-TBMChan.html">Source</a></li><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">stm-chans-3.0.0.4: Additional types of channels for STM.</p></div><div id="content"><div id="module-header"><table class="info"><tr><th valign="top">Copyright</th><td>Copyright (c) 2011--2015 wren gayle romano</td></tr><tr><th>License</th><td>BSD</td></tr><tr><th>Maintainer</th><td>wren@community.haskell.org</td></tr><tr><th>Stability</th><td>provisional</td></tr><tr><th>Portability</th><td>non-portable (GHC STM, DeriveDataTypeable)</td></tr><tr><th>Safe Haskell</th><td>Trustworthy</td></tr><tr><th>Language</th><td>Haskell98</td></tr></table><p class="caption">Control.Concurrent.STM.TBMChan</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">The TBMChan type</a><ul><li><a href="#g:2">Creating TBMChans</a></li><li><a href="#g:3">Reading from TBMChans</a></li><li><a href="#g:4">Writing to TBMChans</a></li><li><a href="#g:5">Closing TBMChans</a></li><li><a href="#g:6">Predicates</a></li><li><a href="#g:7">Other functionality</a></li></ul></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>A version of <a href="file:///usr/share/doc/libghc-stm-doc/html/Control-Concurrent-STM-TChan.html">Control.Concurrent.STM.TChan</a> where the queue is
 bounded in length and closeable. This combines the abilities of
 <a href="Control-Concurrent-STM-TBChan.html">Control.Concurrent.STM.TBChan</a> and <a href="Control-Concurrent-STM-TMChan.html">Control.Concurrent.STM.TMChan</a>.
 This variant incorporates ideas from Thomas M. DuBuisson's
 <code>bounded-tchan</code> package in order to reduce contention between
 readers and writers.</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:TBMChan">TBMChan</a> a</li><li class="src short"><a href="#v:newTBMChan">newTBMChan</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/GHC-Conc.html#t:STM">STM</a> (<a href="Control-Concurrent-STM-TBMChan.html#t:TBMChan">TBMChan</a> a)</li><li class="src short"><a href="#v:newTBMChanIO">newTBMChanIO</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> (<a href="Control-Concurrent-STM-TBMChan.html#t:TBMChan">TBMChan</a> a)</li><li class="src short"><a href="#v:readTBMChan">readTBMChan</a> :: <a href="Control-Concurrent-STM-TBMChan.html#t:TBMChan">TBMChan</a> a -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/GHC-Conc.html#t:STM">STM</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> a)</li><li class="src short"><a href="#v:tryReadTBMChan">tryReadTBMChan</a> :: <a href="Control-Concurrent-STM-TBMChan.html#t:TBMChan">TBMChan</a> a -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/GHC-Conc.html#t:STM">STM</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> a))</li><li class="src short"><a href="#v:peekTBMChan">peekTBMChan</a> :: <a href="Control-Concurrent-STM-TBMChan.html#t:TBMChan">TBMChan</a> a -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/GHC-Conc.html#t:STM">STM</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> a)</li><li class="src short"><a href="#v:tryPeekTBMChan">tryPeekTBMChan</a> :: <a href="Control-Concurrent-STM-TBMChan.html#t:TBMChan">TBMChan</a> a -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/GHC-Conc.html#t:STM">STM</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> a))</li><li class="src short"><a href="#v:writeTBMChan">writeTBMChan</a> :: <a href="Control-Concurrent-STM-TBMChan.html#t:TBMChan">TBMChan</a> a -&gt; a -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/GHC-Conc.html#t:STM">STM</a> ()</li><li class="src short"><a href="#v:tryWriteTBMChan">tryWriteTBMChan</a> :: <a href="Control-Concurrent-STM-TBMChan.html#t:TBMChan">TBMChan</a> a -&gt; a -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/GHC-Conc.html#t:STM">STM</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a>)</li><li class="src short"><a href="#v:unGetTBMChan">unGetTBMChan</a> :: <a href="Control-Concurrent-STM-TBMChan.html#t:TBMChan">TBMChan</a> a -&gt; a -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/GHC-Conc.html#t:STM">STM</a> ()</li><li class="src short"><a href="#v:closeTBMChan">closeTBMChan</a> :: <a href="Control-Concurrent-STM-TBMChan.html#t:TBMChan">TBMChan</a> a -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/GHC-Conc.html#t:STM">STM</a> ()</li><li class="src short"><a href="#v:isClosedTBMChan">isClosedTBMChan</a> :: <a href="Control-Concurrent-STM-TBMChan.html#t:TBMChan">TBMChan</a> a -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/GHC-Conc.html#t:STM">STM</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:isEmptyTBMChan">isEmptyTBMChan</a> :: <a href="Control-Concurrent-STM-TBMChan.html#t:TBMChan">TBMChan</a> a -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/GHC-Conc.html#t:STM">STM</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:isFullTBMChan">isFullTBMChan</a> :: <a href="Control-Concurrent-STM-TBMChan.html#t:TBMChan">TBMChan</a> a -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/GHC-Conc.html#t:STM">STM</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:estimateFreeSlotsTBMChan">estimateFreeSlotsTBMChan</a> :: <a href="Control-Concurrent-STM-TBMChan.html#t:TBMChan">TBMChan</a> a -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/GHC-Conc.html#t:STM">STM</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a></li><li class="src short"><a href="#v:freeSlotsTBMChan">freeSlotsTBMChan</a> :: <a href="Control-Concurrent-STM-TBMChan.html#t:TBMChan">TBMChan</a> a -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/GHC-Conc.html#t:STM">STM</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a></li></ul></div><div id="interface"><h1 id="g:1">The TBMChan type</h1><div class="top"><p class="src"><span class="keyword">data</span> <a id="t:TBMChan" class="def">TBMChan</a> a <a href="src/Control-Concurrent-STM-TBMChan.html#TBMChan" class="link">Source</a> <a href="#t:TBMChan" class="selflink">#</a></p><div class="doc"><p><code>TBMChan</code> is an abstract type representing a bounded closeable
 FIFO channel.</p></div></div><h2 id="g:2">Creating TBMChans</h2><div class="top"><p class="src"><a id="v:newTBMChan" class="def">newTBMChan</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/GHC-Conc.html#t:STM">STM</a> (<a href="Control-Concurrent-STM-TBMChan.html#t:TBMChan">TBMChan</a> a) <a href="src/Control-Concurrent-STM-TBMChan.html#newTBMChan" class="link">Source</a> <a href="#v:newTBMChan" class="selflink">#</a></p><div class="doc"><p>Build and returns a new instance of <code>TBMChan</code> with the given
 capacity. <em>N.B.</em>, we do not verify the capacity is positive, but
 if it is non-positive then <code><a href="Control-Concurrent-STM-TBMChan.html#v:writeTBMChan">writeTBMChan</a></code> will always retry and
 <code><a href="Control-Concurrent-STM-TBMChan.html#v:isFullTBMChan">isFullTBMChan</a></code> will always be true.</p></div></div><div class="top"><p class="src"><a id="v:newTBMChanIO" class="def">newTBMChanIO</a> :: <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO.html#t:IO">IO</a> (<a href="Control-Concurrent-STM-TBMChan.html#t:TBMChan">TBMChan</a> a) <a href="src/Control-Concurrent-STM-TBMChan.html#newTBMChanIO" class="link">Source</a> <a href="#v:newTBMChanIO" class="selflink">#</a></p><div class="doc"><p><code>IO</code> version of <code><a href="Control-Concurrent-STM-TBMChan.html#v:newTBMChan">newTBMChan</a></code>. This is useful for creating
 top-level <code>TBMChan</code>s using <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO-Unsafe.html#v:unsafePerformIO">unsafePerformIO</a></code>, because using
 <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/GHC-Conc.html#v:atomically">atomically</a></code> inside <code><a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/System-IO-Unsafe.html#v:unsafePerformIO">unsafePerformIO</a></code> isn't possible.</p></div></div><h2 id="g:3">Reading from TBMChans</h2><div class="top"><p class="src"><a id="v:readTBMChan" class="def">readTBMChan</a> :: <a href="Control-Concurrent-STM-TBMChan.html#t:TBMChan">TBMChan</a> a -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/GHC-Conc.html#t:STM">STM</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> a) <a href="src/Control-Concurrent-STM-TBMChan.html#readTBMChan" class="link">Source</a> <a href="#v:readTBMChan" class="selflink">#</a></p><div class="doc"><p>Read the next value from the <code>TBMChan</code>, retrying if the channel
 is empty (and not closed). We return <code>Nothing</code> immediately if
 the channel is closed and empty.</p></div></div><div class="top"><p class="src"><a id="v:tryReadTBMChan" class="def">tryReadTBMChan</a> :: <a href="Control-Concurrent-STM-TBMChan.html#t:TBMChan">TBMChan</a> a -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/GHC-Conc.html#t:STM">STM</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> a)) <a href="src/Control-Concurrent-STM-TBMChan.html#tryReadTBMChan" class="link">Source</a> <a href="#v:tryReadTBMChan" class="selflink">#</a></p><div class="doc"><p>A version of <code><a href="Control-Concurrent-STM-TBMChan.html#v:readTBMChan">readTBMChan</a></code> which does not retry. Instead it
 returns <code>Just Nothing</code> if the channel is open but no value is
 available; it still returns <code>Nothing</code> if the channel is closed
 and empty.</p></div></div><div class="top"><p class="src"><a id="v:peekTBMChan" class="def">peekTBMChan</a> :: <a href="Control-Concurrent-STM-TBMChan.html#t:TBMChan">TBMChan</a> a -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/GHC-Conc.html#t:STM">STM</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> a) <a href="src/Control-Concurrent-STM-TBMChan.html#peekTBMChan" class="link">Source</a> <a href="#v:peekTBMChan" class="selflink">#</a></p><div class="doc"><p>Get the next value from the <code>TBMChan</code> without removing it,
 retrying if the channel is empty.</p></div></div><div class="top"><p class="src"><a id="v:tryPeekTBMChan" class="def">tryPeekTBMChan</a> :: <a href="Control-Concurrent-STM-TBMChan.html#t:TBMChan">TBMChan</a> a -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/GHC-Conc.html#t:STM">STM</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> a)) <a href="src/Control-Concurrent-STM-TBMChan.html#tryPeekTBMChan" class="link">Source</a> <a href="#v:tryPeekTBMChan" class="selflink">#</a></p><div class="doc"><p>A version of <code><a href="Control-Concurrent-STM-TBMChan.html#v:peekTBMChan">peekTBMChan</a></code> which does not retry. Instead it
 returns <code>Just Nothing</code> if the channel is open but no value is
 available; it still returns <code>Nothing</code> if the channel is closed
 and empty.</p></div></div><h2 id="g:4">Writing to TBMChans</h2><div class="top"><p class="src"><a id="v:writeTBMChan" class="def">writeTBMChan</a> :: <a href="Control-Concurrent-STM-TBMChan.html#t:TBMChan">TBMChan</a> a -&gt; a -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/GHC-Conc.html#t:STM">STM</a> () <a href="src/Control-Concurrent-STM-TBMChan.html#writeTBMChan" class="link">Source</a> <a href="#v:writeTBMChan" class="selflink">#</a></p><div class="doc"><p>Write a value to a <code>TBMChan</code>, retrying if the channel is full.
 If the channel is closed then the value is silently discarded.
 Use <code><a href="Control-Concurrent-STM-TBMChan.html#v:isClosedTBMChan">isClosedTBMChan</a></code> to determine if the channel is closed
 before writing, as needed.</p></div></div><div class="top"><p class="src"><a id="v:tryWriteTBMChan" class="def">tryWriteTBMChan</a> :: <a href="Control-Concurrent-STM-TBMChan.html#t:TBMChan">TBMChan</a> a -&gt; a -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/GHC-Conc.html#t:STM">STM</a> (<a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Maybe.html#t:Maybe">Maybe</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a>) <a href="src/Control-Concurrent-STM-TBMChan.html#tryWriteTBMChan" class="link">Source</a> <a href="#v:tryWriteTBMChan" class="selflink">#</a></p><div class="doc"><p>A version of <code><a href="Control-Concurrent-STM-TBMChan.html#v:writeTBMChan">writeTBMChan</a></code> which does not retry. Returns <code>Just
 True</code> if the value was successfully written, <code>Just False</code> if it
 could not be written (but the channel was open), and <code>Nothing</code>
 if it was discarded (i.e., the channel was closed).</p></div></div><div class="top"><p class="src"><a id="v:unGetTBMChan" class="def">unGetTBMChan</a> :: <a href="Control-Concurrent-STM-TBMChan.html#t:TBMChan">TBMChan</a> a -&gt; a -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/GHC-Conc.html#t:STM">STM</a> () <a href="src/Control-Concurrent-STM-TBMChan.html#unGetTBMChan" class="link">Source</a> <a href="#v:unGetTBMChan" class="selflink">#</a></p><div class="doc"><p>Put a data item back onto a channel, where it will be the next
 item read. If the channel is closed then the value is silently
 discarded; you can use <code><a href="Control-Concurrent-STM-TBMChan.html#v:peekTBMChan">peekTBMChan</a></code> to circumvent this in certain
 circumstances. <em>N.B.</em>, this could allow the channel to temporarily
 become longer than the specified limit, which is necessary to
 ensure that the item is indeed the next one read.</p></div></div><h2 id="g:5">Closing TBMChans</h2><div class="top"><p class="src"><a id="v:closeTBMChan" class="def">closeTBMChan</a> :: <a href="Control-Concurrent-STM-TBMChan.html#t:TBMChan">TBMChan</a> a -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/GHC-Conc.html#t:STM">STM</a> () <a href="src/Control-Concurrent-STM-TBMChan.html#closeTBMChan" class="link">Source</a> <a href="#v:closeTBMChan" class="selflink">#</a></p><div class="doc"><p>Closes the <code>TBMChan</code>, preventing any further writes.</p></div></div><h2 id="g:6">Predicates</h2><div class="top"><p class="src"><a id="v:isClosedTBMChan" class="def">isClosedTBMChan</a> :: <a href="Control-Concurrent-STM-TBMChan.html#t:TBMChan">TBMChan</a> a -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/GHC-Conc.html#t:STM">STM</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> <a href="src/Control-Concurrent-STM-TBMChan.html#isClosedTBMChan" class="link">Source</a> <a href="#v:isClosedTBMChan" class="selflink">#</a></p><div class="doc"><p>Returns <code>True</code> if the supplied <code>TBMChan</code> has been closed.</p></div></div><div class="top"><p class="src"><a id="v:isEmptyTBMChan" class="def">isEmptyTBMChan</a> :: <a href="Control-Concurrent-STM-TBMChan.html#t:TBMChan">TBMChan</a> a -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/GHC-Conc.html#t:STM">STM</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> <a href="src/Control-Concurrent-STM-TBMChan.html#isEmptyTBMChan" class="link">Source</a> <a href="#v:isEmptyTBMChan" class="selflink">#</a></p><div class="doc"><p>Returns <code>True</code> if the supplied <code>TBMChan</code> is empty (i.e., has
 no elements). <em>N.B.</em>, a <code>TBMChan</code> can be both `<code>empty'</code> and
 `<code>full'</code> at the same time, if the initial limit was non-positive.</p></div></div><div class="top"><p class="src"><a id="v:isFullTBMChan" class="def">isFullTBMChan</a> :: <a href="Control-Concurrent-STM-TBMChan.html#t:TBMChan">TBMChan</a> a -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/GHC-Conc.html#t:STM">STM</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Bool.html#t:Bool">Bool</a> <a href="src/Control-Concurrent-STM-TBMChan.html#isFullTBMChan" class="link">Source</a> <a href="#v:isFullTBMChan" class="selflink">#</a></p><div class="doc"><p>Returns <code>True</code> if the supplied <code>TBMChan</code> is full (i.e., is
 over its limit). <em>N.B.</em>, a <code>TBMChan</code> can be both `<code>empty'</code> and
 `<code>full'</code> at the same time, if the initial limit was non-positive.
 <em>N.B.</em>, a <code>TBMChan</code> may still be full after reading, if
 <code><a href="Control-Concurrent-STM-TBMChan.html#v:unGetTBMChan">unGetTBMChan</a></code> was used to go over the initial limit.</p><p>This is equivalent to: <code>liftM (&lt;= 0) estimateFreeSlotsTBMChan</code></p></div></div><h2 id="g:7">Other functionality</h2><div class="top"><p class="src"><a id="v:estimateFreeSlotsTBMChan" class="def">estimateFreeSlotsTBMChan</a> :: <a href="Control-Concurrent-STM-TBMChan.html#t:TBMChan">TBMChan</a> a -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/GHC-Conc.html#t:STM">STM</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> <a href="src/Control-Concurrent-STM-TBMChan.html#estimateFreeSlotsTBMChan" class="link">Source</a> <a href="#v:estimateFreeSlotsTBMChan" class="selflink">#</a></p><div class="doc"><p>Estimate the number of free slots. If the result is positive,
 then it's a minimum bound; if it's non-positive then it's exact.
 It will only be negative if the initial limit was negative or
 if <code><a href="Control-Concurrent-STM-TBMChan.html#v:unGetTBMChan">unGetTBMChan</a></code> was used to go over the initial limit.</p><p>This function always contends with writers, but only contends
 with readers when it has to; compare against <code><a href="Control-Concurrent-STM-TBMChan.html#v:freeSlotsTBMChan">freeSlotsTBMChan</a></code>.</p></div></div><div class="top"><p class="src"><a id="v:freeSlotsTBMChan" class="def">freeSlotsTBMChan</a> :: <a href="Control-Concurrent-STM-TBMChan.html#t:TBMChan">TBMChan</a> a -&gt; <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/GHC-Conc.html#t:STM">STM</a> <a href="file:///usr/share/doc/ghc-doc/html/libraries/base-4.9.1.0/Data-Int.html#t:Int">Int</a> <a href="src/Control-Concurrent-STM-TBMChan.html#freeSlotsTBMChan" class="link">Source</a> <a href="#v:freeSlotsTBMChan" class="selflink">#</a></p><div class="doc"><p>Return the exact number of free slots. The result can be
 negative if the initial limit was negative or if <code><a href="Control-Concurrent-STM-TBMChan.html#v:unGetTBMChan">unGetTBMChan</a></code>
 was used to go over the initial limit.</p><p>This function always contends with both readers and writers;
 compare against <code><a href="Control-Concurrent-STM-TBMChan.html#v:estimateFreeSlotsTBMChan">estimateFreeSlotsTBMChan</a></code>.</p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.17.3</p></div></body></html>