The $ function is essentialy a &quot;no-op&quot;. That is, it literally does nothing. There is no difference in Haskell between a function and a reference to it. The only purpose of $ is for grouping. The line in question below could have been written identically as &quot;fromQty &lt;- atomically (readTVar fromBal)&quot;. The $ groups together everything to the end of the line, and can be used to avoid parentheses that could add noise to the code.<br>
<br><div class="gmail_quote">On Mon, Feb 23, 2009 at 1:18 PM, Michael Easter <span dir="ltr">&lt;<a href="mailto:codetojoy@gmail.com">codetojoy@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>re: desugaring.&nbsp; Thanks Andrew, that worked great! <br><br>I have another, easier question from the same code in RWH:<br><br>bogusTransfer qty fromBal toBal = do<br>&nbsp;&nbsp;&nbsp; fromQty &lt;- atomically $ readTVar fromBal<br>&nbsp;&nbsp;&nbsp; [snip]<br>

<br>Can someone please explain the ($) function in English? From the type signature, it seems to be an &quot;apply function&quot;, but I can&#39;t quite explain when we use it. Clearly, it is used throughout RWH but I haven&#39;t found a good explanation.<br>

<br>My guess is that it is when we want an &quot;execution&quot; of a function rather than a mere reference to it. Is that accurate?<br><br>thanks again<br>Michael<br><font color="#888888"><br>-- <br>----------------------<br>
Michael Easter<br>
<a href="http://codetojoy.blogspot.com" target="_blank">http://codetojoy.blogspot.com</a>: Putting the thrill back in blog<br><br><a href="http://youtube.com/ocitv" target="_blank">http://youtube.com/ocitv</a> -&gt; Fun people doing serious software engineering<br>


</font></blockquote></div><br>