(Sorry for the double mail)<br>...so there is no way to do that inside the function passed to modifySTRef?<br>In other words, there is no way to ensure *inside* a function that its result will be evaluated strictly?<br><br>
<div class="gmail_quote">2011/11/18 Daniel Fischer <span dir="ltr"><<a href="mailto:daniel.is.fischer@googlemail.com">daniel.is.fischer@googlemail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Friday 18 November 2011, 11:18:33, Yves Parès wrote:<br>
> Instead of rewriting modifySTRef, why not just do :<br>
><br>
> modifySTRef counter (\x -> let y = x+1 in y `seq` y)<br>
><br>
> Is there a problem with that?<br>
<br>
</div>Yes, y `seq` y is precisely the same as y.<br>
<br>
a `seq` b means whenever evaluation of b is demanded, also evaluate a (to<br>
WHNF).<br>
So y `seq` y ~> whenever evaluation of y is demanded, also evaluate y.<br>
</blockquote></div><br>