<div class="gmail_quote">On Wed, Aug 18, 2010 at 2:47 PM, Ian Lynagh <span dir="ltr">&lt;<a href="mailto:igloo@earth.li">igloo@earth.li</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<div class="im">On Wed, Aug 18, 2010 at 12:01:54PM +0200, Johan Tibell wrote:<br>
&gt;<br>
&gt;     foldlWithKey&#39; :: (b -&gt; k -&gt; a -&gt; b) -&gt; b -&gt; Map k a -&gt; b<br>
&gt;     foldlWithKey&#39; f z0 m = go z0 m<br>
&gt;       where<br>
&gt;         go z Tip              = z<br>
&gt;         go z (Bin _ kx x l r) = let x&#39; = f (go z l) kx x in x&#39; `seq` go x&#39; r<br>
&gt;<br>
</div><div class="im">&gt; Could someone please explain the difference. I would like to be able<br>
&gt; to to understand when I would get the former or the latter by looking<br>
&gt; at the Haskell source.<br>
<br>
</div>If f is not strict in its first argument (e.g. if it always ignore it)<br>
then go is not strict in z.<br></blockquote></div><br>I understand that f isn&#39;t strict in its first argument in general but in my particular example it is, so why isn&#39;t it detected as such after f has been inlined in go? If you manually inline f into go the problem remains.<br>

<br>Btw, this is using 6.12.2 in case that matters.<br><br>Cheers,<br>Johan<br><br><br>