Is there a state monad that is strict on the state but lazy on the computation? Of course, strictness in the state will force a portion of the computation to be run, but there may be significant portions of it which are not run. Would there be a way to write a state monad such that it is entirely lazy, but then to wrap either the computation or the state in an &#39;eager&#39; strategy datatype which takes care of this in a more flexible manner?<br>
<br>Thanks,<br><br>Matthew<br><br><div class="gmail_quote">2009/11/11 Bryan O&#39;Sullivan <span dir="ltr">&lt;<a href="mailto:bos@serpentine.com">bos@serpentine.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im"><div class="gmail_quote">On Wed, Nov 11, 2009 at 7:43 AM, David Leimbach <span dir="ltr">&lt;<a href="mailto:leimy2k@gmail.com" target="_blank">leimy2k@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<div><br></div><div>I recently ran into some serious space leak difficulties that would ultimately cause this program to crash some time after startup (my simulator is also written in Haskell, and runs a LOT faster than the real application ever could, this has enabled me to fast forward a bit the data growth issues and crash in minutes instead of days!)  </div>


<div></div></blockquote></div><br></div><div>It sounds to me like you were storing a Map in a StateT. Since the usual State and StateT monads don&#39;t force the evaluation of their payload, I&#39;m not terribly surprised that such a leak should arise.</div>

<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" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
<br></blockquote></div><br>