<br clear="all">Folks,<br><br>I have an example of the do-syntax that I would like to desugar. 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> players@(alice:bob:_) <- atomically populateWorld<br> atomically $ alwaysSucceeds =<< consistentBalance players<br> bogusSale Wand 5 alice bob<br><br>I'm having problems especially with the 2nd line in the do block (i.e. the predicate for alwaysSucceeds). I would like to try and express this in terms of only bind (->) and return.<br>
<br>thanks!<br>Michael<br><br>-- <br>----------------------<br>Michael Easter<br><a href="http://codetojoy.blogspot.com">http://codetojoy.blogspot.com</a>: Putting the thrill back in blog<br><br><a href="http://youtube.com/ocitv">http://youtube.com/ocitv</a> -> Fun people doing serious software engineering<br>