I am having hard time making sense of GHC.Conc.   Is there a writeup that describes the significance of &quot;#&quot;, or the meaning of &quot;primOp&quot; and &quot;primType&quot;?<br><br>Thanks<br><br>Daryoush<br><br><div class="gmail_quote">
On Sun, Dec 7, 2008 at 11:48 PM, Don Stewart <span dir="ltr">&lt;<a href="mailto:dons@galois.com">dons@galois.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
dmehrtash:<br>
<div class="im">&gt;    Any idea was the atomically# mean in the following code?<br>
&gt;<br>
&gt;    atomically :: STM a -&gt; IO a<br>
&gt;    atomically (STM m) = IO (\s -&gt; (atomically# m) s )<br>
&gt;<br>
&gt;    Code is from GHC.Conc module<br>
</div>&gt;    [1]<a href="http://www.haskell.org/ghc/docs/6.6/html/libraries/base/GHC-Conc.html" target="_blank">http://www.haskell.org/ghc/docs/6.6/html/libraries/base/GHC-Conc.html</a><br>
<br>
It is a primitive hook into the runtime, where transactional memory is<br>
implemented.<br>
<br>
It is documented in the primops module in the GHC source,<br>
<br>
    $ cd ghc/compiler/prelude/<br>
<br>
    ------------------------------------------------------------------------<br>
    section &quot;STM-accessible Mutable Variables&quot;<br>
    ------------------------------------------------------------------------<br>
<br>
    primtype TVar# s a<br>
<br>
    primop  AtomicallyOp &quot;atomically#&quot; GenPrimOp<br>
          (State# RealWorld -&gt; (# State# RealWorld, a #) )<br>
       -&gt; State# RealWorld -&gt; (# State# RealWorld, a #)<br>
       with<br>
       out_of_line = True<br>
       has_side_effects = True<br>
<br>
    primop  RetryOp &quot;retry#&quot; GenPrimOp<br>
       State# RealWorld -&gt; (# State# RealWorld, a #)<br>
       with<br>
       out_of_line = True<br>
       has_side_effects = True<br>
<br>
<br>
Along with other primitives like:<br>
<br>
------------------------------------------------------------------------<br>
section &quot;Parallelism&quot;<br>
------------------------------------------------------------------------<br>
<br>
    primop  ParOp &quot;par#&quot; GenPrimOp<br>
       a -&gt; Int#<br>
       with<br>
          -- Note that Par is lazy to avoid that the sparked thing<br>
          -- gets evaluted strictly, which it should *not* be<br>
       has_side_effects = True<br>
<font color="#888888"><br>
-- Don<br>
</font></blockquote></div><br><br>