/usr/share/doc/libghc-stm-doc/html/Control-Concurrent-STM-TMVar.html is in libghc-stm-doc 2.4.2-1.
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 | <!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.TMVar</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-STM-TMVar.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Control-Concurrent-STM-TMVar.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-2.4.2: Software Transactional Memory</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Portability</th><td>non-portable (requires STM)</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.STM.TMVar</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">TMVars
</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>TMVar: Transactional MVars, for use in the STM monad
(GHC only)
</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:TMVar">TMVar</a> a</li><li class="src short"><a href="#v:newTMVar">newTMVar</a> :: a -> <a href="Control-Monad-STM.html#t:STM">STM</a> (<a href="Control-Concurrent-STM-TMVar.html#t:TMVar">TMVar</a> a)</li><li class="src short"><a href="#v:newEmptyTMVar">newEmptyTMVar</a> :: <a href="Control-Monad-STM.html#t:STM">STM</a> (<a href="Control-Concurrent-STM-TMVar.html#t:TMVar">TMVar</a> a)</li><li class="src short"><a href="#v:newTMVarIO">newTMVarIO</a> :: a -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> (<a href="Control-Concurrent-STM-TMVar.html#t:TMVar">TMVar</a> a)</li><li class="src short"><a href="#v:newEmptyTMVarIO">newEmptyTMVarIO</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> (<a href="Control-Concurrent-STM-TMVar.html#t:TMVar">TMVar</a> a)</li><li class="src short"><a href="#v:takeTMVar">takeTMVar</a> :: <a href="Control-Concurrent-STM-TMVar.html#t:TMVar">TMVar</a> a -> <a href="Control-Monad-STM.html#t:STM">STM</a> a</li><li class="src short"><a href="#v:putTMVar">putTMVar</a> :: <a href="Control-Concurrent-STM-TMVar.html#t:TMVar">TMVar</a> a -> a -> <a href="Control-Monad-STM.html#t:STM">STM</a> ()</li><li class="src short"><a href="#v:readTMVar">readTMVar</a> :: <a href="Control-Concurrent-STM-TMVar.html#t:TMVar">TMVar</a> a -> <a href="Control-Monad-STM.html#t:STM">STM</a> a</li><li class="src short"><a href="#v:tryReadTMVar">tryReadTMVar</a> :: <a href="Control-Concurrent-STM-TMVar.html#t:TMVar">TMVar</a> a -> <a href="Control-Monad-STM.html#t:STM">STM</a> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> a)</li><li class="src short"><a href="#v:swapTMVar">swapTMVar</a> :: <a href="Control-Concurrent-STM-TMVar.html#t:TMVar">TMVar</a> a -> a -> <a href="Control-Monad-STM.html#t:STM">STM</a> a</li><li class="src short"><a href="#v:tryTakeTMVar">tryTakeTMVar</a> :: <a href="Control-Concurrent-STM-TMVar.html#t:TMVar">TMVar</a> a -> <a href="Control-Monad-STM.html#t:STM">STM</a> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> a)</li><li class="src short"><a href="#v:tryPutTMVar">tryPutTMVar</a> :: <a href="Control-Concurrent-STM-TMVar.html#t:TMVar">TMVar</a> a -> a -> <a href="Control-Monad-STM.html#t:STM">STM</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:isEmptyTMVar">isEmptyTMVar</a> :: <a href="Control-Concurrent-STM-TMVar.html#t:TMVar">TMVar</a> a -> <a href="Control-Monad-STM.html#t:STM">STM</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#t:Bool">Bool</a></li></ul></div><div id="interface"><h1 id="g:1">TMVars
</h1><div class="top"><p class="src"><span class="keyword">data</span> <a name="t:TMVar" class="def">TMVar</a> a <a href="src/Control-Concurrent-STM-TMVar.html#TMVar" class="link">Source</a></p><div class="doc"><p>A <code><a href="Control-Concurrent-STM-TMVar.html#t:TMVar">TMVar</a></code> is a synchronising variable, used
for communication between concurrent threads. It can be thought of
as a box, which may be empty or full.
</p></div><div class="subs instances"><p id="control.i:TMVar" class="caption collapser" onclick="toggleSection('i:TMVar')">Instances</p><div id="section.i:TMVar" class="show"><table><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Typeable-Internal.html#t:Typeable1">Typeable1</a> <a href="Control-Concurrent-STM-TMVar.html#t:TMVar">TMVar</a></td><td class="doc empty"> </td></tr><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> (<a href="Control-Concurrent-STM-TMVar.html#t:TMVar">TMVar</a> a)</td><td class="doc empty"> </td></tr></table></div></div></div><div class="top"><p class="src"><a name="v:newTMVar" class="def">newTMVar</a> :: a -> <a href="Control-Monad-STM.html#t:STM">STM</a> (<a href="Control-Concurrent-STM-TMVar.html#t:TMVar">TMVar</a> a)<a href="src/Control-Concurrent-STM-TMVar.html#newTMVar" class="link">Source</a></p><div class="doc"><p>Create a <code><a href="Control-Concurrent-STM-TMVar.html#t:TMVar">TMVar</a></code> which contains the supplied value.
</p></div></div><div class="top"><p class="src"><a name="v:newEmptyTMVar" class="def">newEmptyTMVar</a> :: <a href="Control-Monad-STM.html#t:STM">STM</a> (<a href="Control-Concurrent-STM-TMVar.html#t:TMVar">TMVar</a> a)<a href="src/Control-Concurrent-STM-TMVar.html#newEmptyTMVar" class="link">Source</a></p><div class="doc"><p>Create a <code><a href="Control-Concurrent-STM-TMVar.html#t:TMVar">TMVar</a></code> which is initially empty.
</p></div></div><div class="top"><p class="src"><a name="v:newTMVarIO" class="def">newTMVarIO</a> :: a -> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> (<a href="Control-Concurrent-STM-TMVar.html#t:TMVar">TMVar</a> a)<a href="src/Control-Concurrent-STM-TMVar.html#newTMVarIO" class="link">Source</a></p><div class="doc"><p><code>IO</code> version of <code><a href="Control-Concurrent-STM-TMVar.html#v:newTMVar">newTMVar</a></code>. This is useful for creating top-level
<code><a href="Control-Concurrent-STM-TMVar.html#t:TMVar">TMVar</a></code>s using <code><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO-Unsafe.html#t:unsafePerformIO">unsafePerformIO</a></code>, because using
<code><a href="Control-Monad-STM.html#v:atomically">atomically</a></code> inside <code><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO-Unsafe.html#t:unsafePerformIO">unsafePerformIO</a></code> isn't
possible.
</p></div></div><div class="top"><p class="src"><a name="v:newEmptyTMVarIO" class="def">newEmptyTMVarIO</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO.html#t:IO">IO</a> (<a href="Control-Concurrent-STM-TMVar.html#t:TMVar">TMVar</a> a)<a href="src/Control-Concurrent-STM-TMVar.html#newEmptyTMVarIO" class="link">Source</a></p><div class="doc"><p><code>IO</code> version of <code><a href="Control-Concurrent-STM-TMVar.html#v:newEmptyTMVar">newEmptyTMVar</a></code>. This is useful for creating top-level
<code><a href="Control-Concurrent-STM-TMVar.html#t:TMVar">TMVar</a></code>s using <code><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO-Unsafe.html#t:unsafePerformIO">unsafePerformIO</a></code>, because using
<code><a href="Control-Monad-STM.html#v:atomically">atomically</a></code> inside <code><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/System-IO-Unsafe.html#t:unsafePerformIO">unsafePerformIO</a></code> isn't
possible.
</p></div></div><div class="top"><p class="src"><a name="v:takeTMVar" class="def">takeTMVar</a> :: <a href="Control-Concurrent-STM-TMVar.html#t:TMVar">TMVar</a> a -> <a href="Control-Monad-STM.html#t:STM">STM</a> a<a href="src/Control-Concurrent-STM-TMVar.html#takeTMVar" class="link">Source</a></p><div class="doc"><p>Return the contents of the <code><a href="Control-Concurrent-STM-TMVar.html#t:TMVar">TMVar</a></code>. If the <code><a href="Control-Concurrent-STM-TMVar.html#t:TMVar">TMVar</a></code> is currently
empty, the transaction will <code><a href="Control-Monad-STM.html#v:retry">retry</a></code>. After a <code><a href="Control-Concurrent-STM-TMVar.html#v:takeTMVar">takeTMVar</a></code>,
the <code><a href="Control-Concurrent-STM-TMVar.html#t:TMVar">TMVar</a></code> is left empty.
</p></div></div><div class="top"><p class="src"><a name="v:putTMVar" class="def">putTMVar</a> :: <a href="Control-Concurrent-STM-TMVar.html#t:TMVar">TMVar</a> a -> a -> <a href="Control-Monad-STM.html#t:STM">STM</a> ()<a href="src/Control-Concurrent-STM-TMVar.html#putTMVar" class="link">Source</a></p><div class="doc"><p>Put a value into a <code><a href="Control-Concurrent-STM-TMVar.html#t:TMVar">TMVar</a></code>. If the <code><a href="Control-Concurrent-STM-TMVar.html#t:TMVar">TMVar</a></code> is currently full,
<code><a href="Control-Concurrent-STM-TMVar.html#v:putTMVar">putTMVar</a></code> will <code><a href="Control-Monad-STM.html#v:retry">retry</a></code>.
</p></div></div><div class="top"><p class="src"><a name="v:readTMVar" class="def">readTMVar</a> :: <a href="Control-Concurrent-STM-TMVar.html#t:TMVar">TMVar</a> a -> <a href="Control-Monad-STM.html#t:STM">STM</a> a<a href="src/Control-Concurrent-STM-TMVar.html#readTMVar" class="link">Source</a></p><div class="doc"><p>This is a combination of <code><a href="Control-Concurrent-STM-TMVar.html#v:takeTMVar">takeTMVar</a></code> and <code><a href="Control-Concurrent-STM-TMVar.html#v:putTMVar">putTMVar</a></code>; ie. it
takes the value from the <code><a href="Control-Concurrent-STM-TMVar.html#t:TMVar">TMVar</a></code>, puts it back, and also returns
it.
</p></div></div><div class="top"><p class="src"><a name="v:tryReadTMVar" class="def">tryReadTMVar</a> :: <a href="Control-Concurrent-STM-TMVar.html#t:TMVar">TMVar</a> a -> <a href="Control-Monad-STM.html#t:STM">STM</a> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> a)<a href="src/Control-Concurrent-STM-TMVar.html#tryReadTMVar" class="link">Source</a></p><div class="doc"><p>A version of <code><a href="Control-Concurrent-STM-TMVar.html#v:readTMVar">readTMVar</a></code> which does not retry. Instead it
returns <code>Nothing</code> if no value is available.
</p></div></div><div class="top"><p class="src"><a name="v:swapTMVar" class="def">swapTMVar</a> :: <a href="Control-Concurrent-STM-TMVar.html#t:TMVar">TMVar</a> a -> a -> <a href="Control-Monad-STM.html#t:STM">STM</a> a<a href="src/Control-Concurrent-STM-TMVar.html#swapTMVar" class="link">Source</a></p><div class="doc"><p>Swap the contents of a <code><a href="Control-Concurrent-STM-TMVar.html#t:TMVar">TMVar</a></code> for a new value.
</p></div></div><div class="top"><p class="src"><a name="v:tryTakeTMVar" class="def">tryTakeTMVar</a> :: <a href="Control-Concurrent-STM-TMVar.html#t:TMVar">TMVar</a> a -> <a href="Control-Monad-STM.html#t:STM">STM</a> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> a)<a href="src/Control-Concurrent-STM-TMVar.html#tryTakeTMVar" class="link">Source</a></p><div class="doc"><p>A version of <code><a href="Control-Concurrent-STM-TMVar.html#v:takeTMVar">takeTMVar</a></code> that does not <code><a href="Control-Monad-STM.html#v:retry">retry</a></code>. The <code><a href="Control-Concurrent-STM-TMVar.html#v:tryTakeTMVar">tryTakeTMVar</a></code>
function returns <code><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#v:Nothing">Nothing</a></code> if the <code><a href="Control-Concurrent-STM-TMVar.html#t:TMVar">TMVar</a></code> was empty, or <code><code><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#v:Just">Just</a></code> a</code> if
the <code><a href="Control-Concurrent-STM-TMVar.html#t:TMVar">TMVar</a></code> was full with contents <code>a</code>. After <code><a href="Control-Concurrent-STM-TMVar.html#v:tryTakeTMVar">tryTakeTMVar</a></code>, the
<code><a href="Control-Concurrent-STM-TMVar.html#t:TMVar">TMVar</a></code> is left empty.
</p></div></div><div class="top"><p class="src"><a name="v:tryPutTMVar" class="def">tryPutTMVar</a> :: <a href="Control-Concurrent-STM-TMVar.html#t:TMVar">TMVar</a> a -> a -> <a href="Control-Monad-STM.html#t:STM">STM</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#t:Bool">Bool</a><a href="src/Control-Concurrent-STM-TMVar.html#tryPutTMVar" class="link">Source</a></p><div class="doc"><p>A version of <code><a href="Control-Concurrent-STM-TMVar.html#v:putTMVar">putTMVar</a></code> that does not <code><a href="Control-Monad-STM.html#v:retry">retry</a></code>. The <code><a href="Control-Concurrent-STM-TMVar.html#v:tryPutTMVar">tryPutTMVar</a></code>
function attempts to put the value <code>a</code> into the <code><a href="Control-Concurrent-STM-TMVar.html#t:TMVar">TMVar</a></code>, returning
<code><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#v:True">True</a></code> if it was successful, or <code><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#v:False">False</a></code> otherwise.
</p></div></div><div class="top"><p class="src"><a name="v:isEmptyTMVar" class="def">isEmptyTMVar</a> :: <a href="Control-Concurrent-STM-TMVar.html#t:TMVar">TMVar</a> a -> <a href="Control-Monad-STM.html#t:STM">STM</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#t:Bool">Bool</a><a href="src/Control-Concurrent-STM-TMVar.html#isEmptyTMVar" class="link">Source</a></p><div class="doc"><p>Check whether a given <code><a href="Control-Concurrent-STM-TMVar.html#t:TMVar">TMVar</a></code> is empty.
</p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.13.2</p></div></body></html>
|