On Wed, Oct 19, 2011 at 12:21 PM, Gregory Collins <span dir="ltr">&lt;<a href="mailto:greg@gregorycollins.net">greg@gregorycollins.net</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div class="im">On Wed, Oct 19, 2011 at 5:03 PM, Johan Tibell &lt;<a href="mailto:johan.tibell@gmail.com">johan.tibell@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt; It does. You need to use evaluate to have ensure actually be evaluated.<br>
&gt;<br>
<br>
</div>I&#39;m almost certain you&#39;re wrong about this. The bang pattern on the<br>
return from ensure (!r1 &lt;- ensure $ ...) forces r1 to WHNF, which goes<br>
through deepseq, and thus the whole list is forced. See<br>
<a href="https://gist.github.com/1299380" target="_blank">https://gist.github.com/1299380</a> for a short counterexample.</blockquote><div><br></div><div>I should have paid more attention; I missed the bangs on the bindings.</div>

<div><br></div><div>I still recommend the pattern I linked in my previous email. If you want to do it they way you currently do use</div><div><br></div><div>    let !foo = xs `deepseq` xs</div><div><br></div><div>no return needed.</div>

<div><br></div></div>