On Wed, Aug 18, 2010 at 2:47 PM, Ian Lynagh <ig...@earth.li> wrote: > On Wed, Aug 18, 2010 at 12:01:54PM +0200, Johan Tibell wrote: > > > > foldlWithKey' :: (b -> k -> a -> b) -> b -> Map k a -> b > > foldlWithKey' f z0 m = go z0 m > > where > > go z Tip = z > > go z (Bin _ kx x l r) = let x' = f (go z l) kx x in x' `seq` go > x' r > > > > Could someone please explain the difference. I would like to be able > > to to understand when I would get the former or the latter by looking > > at the Haskell source. > > If f is not strict in its first argument (e.g. if it always ignore it) > then go is not strict in z. >
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. Btw, this is using 6.12.2 in case that matters. Cheers, Johan
_______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users