<div class="gmail_quote">2008/12/21 Peter Todd <span dir="ltr">&lt;<a href="mailto:pete@petertodd.org">pete@petertodd.org</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
If I could somehow arrange for the transform function to detect when it<br>
is being applied to a unevaluated thunk, and then modify the thunk in<br>
place, that would basically be the behavior I need. Any suggestions?</blockquote><div><br></div><div>That is exactly what is already happening. &nbsp;Perhaps you want what you think is happening: if a value *is* evaluated, you want to apply the transformation right then instead of making a thunk.</div>
<div><br></div><div>By the way, this is very operational thinking for Haskell. &nbsp;Haskell tries quite hard to abstract away operational thinking, so thinking on this level will be difficult and more work than you should be doing to write a program.</div>
<div><br></div><div>May I ask why you want this behavior? &nbsp;Have you just tested it and observed that it is running too slowly and you are trying to speed it up?</div><div><br></div><div>Luke</div></div>