I like monadic reformulations when they remove repetitious patterns from code, such as reading/updating a single threaded state.&nbsp; I&#39;m not yet seeing such a pattern in your case.&nbsp; As you mentioned:<br><br><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">
The &quot;shape&quot; of the<br>state isn&#39;t constant throughout the process. At any given step, new<br>information may be added to the state, and old information may be thrown<br>away, if there is no further need for it.
<br></blockquote><br>So I&#39;m still doubtful that a monadic approach is going to simplify your code.&nbsp;&nbsp; Would you give a real example of some code you&#39;d like to make more manageable?&nbsp; If you have real examples of State, Reader, and/or Writer monads that strike you as similar to your example, please share that also.
<br><br>Cheers, - Conal<br><br><div><span class="gmail_quote">On 12/26/06, <b class="gmail_sendername">Steve Schafer</b> &lt;<a href="mailto:steve@fenestra.com">steve@fenestra.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Mon, 25 Dec 2006 09:52:47 -0800, you wrote:<br><br>&gt;To my eye, your example code below looks less like an imperative<br>&gt;program than like an intermediate form that a compiler would generate<br>&gt;from an expression built up from nested function applications and a
<br>&gt;few &quot;let&quot;s.<br><br>That&#39;s very true, but the same could be said for many other examples<br>of the use of the State monad (and Reader and Writer as well). They<br>frequently don&#39;t do anything that couldn&#39;t be done purely
<br>functionally.<br><br>Steve Schafer<br>Fenestra Technologies Corp.<br><a href="http://www.fenestra.com/">http://www.fenestra.com/</a><br>_______________________________________________<br>Haskell-Cafe mailing list<br><a href="mailto:Haskell-Cafe@haskell.org">
Haskell-Cafe@haskell.org</a><br><a href="http://www.haskell.org/mailman/listinfo/haskell-cafe">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br></blockquote></div><br>