Here&#39;s my attempt (without a typechecker):<div>tryBogusSale = atomically populateWorld &gt;&gt;= \players@(alice:bob:_) -&gt;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; atomically (consistentBalance players &gt;&gt;= alwaysSucceeds) &gt;&gt;&nbsp;</div>
<div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;bogusSale Wand 5 alice bob<br><br><div class="gmail_quote">On Mon, Feb 23, 2009 at 9:33 AM, 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 clear="all">Folks,<br><br>I have an example of the do-syntax that I would like to desugar.&nbsp; It is an example from Chapter 28 in RWH.<br>
<br>I think I understand the ideas behind the following STM example, but I would like to present it to others in a desugared way:<br>
<br>tryBogusSale = do<br>&nbsp;&nbsp;&nbsp; players@(alice:bob:_) &lt;- atomically populateWorld<br>&nbsp;&nbsp;&nbsp; atomically $ alwaysSucceeds =&lt;&lt; consistentBalance players<br>&nbsp;&nbsp;&nbsp; bogusSale Wand 5 alice bob<br><br>I&#39;m having problems especially with the 2nd line in the do block (i.e. the predicate for alwaysSucceeds).&nbsp; I would like to try and express this in terms of only bind (-&gt;) and return.<br>

<br>thanks!<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><br>_______________________________________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org">Beginners@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/beginners" target="_blank">http://www.haskell.org/mailman/listinfo/beginners</a><br>
<br></blockquote></div><br></div>