<div class="gmail_quote">On Wed, Aug 18, 2010 at 2:47 PM, Ian Lynagh <span dir="ltr"><<a href="mailto:igloo@earth.li">igloo@earth.li</a>></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>
><br>
> foldlWithKey' :: (b -> k -> a -> b) -> b -> Map k a -> b<br>
> foldlWithKey' f z0 m = go z0 m<br>
> where<br>
> go z Tip = z<br>
> go z (Bin _ kx x l r) = let x' = f (go z l) kx x in x' `seq` go x' r<br>
><br>
</div><div class="im">> Could someone please explain the difference. I would like to be able<br>
> to to understand when I would get the former or the latter by looking<br>
> 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't strict in its first argument in general but in my particular example it is, so why isn'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>