I like monadic reformulations when they remove repetitious patterns from code, such as reading/updating a single threaded state. I'm not yet seeing such a pattern in your case. 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 "shape" of the<br>state isn'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'm still doubtful that a monadic approach is going to simplify your code. Would you give a real example of some code you'd like to make more manageable? 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> <<a href="mailto:email@example.com">firstname.lastname@example.org</a>> 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>>To my eye, your example code below looks less like an imperative<br>>program than like an intermediate form that a compiler would generate<br>>from an expression built up from nested function applications and a
<br>>few "let"s.<br><br>That'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't do anything that couldn'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">