myFoldl :: (a -> b -> a) -> a -> [b] -> a

myFoldl f z xs = foldr step id xs z
    where step x g a = g (f a x)

I know myFoldl implements foldl using foldr. However i really donot know how
it can do it ?

Please shed a light one me, thanks!
-- 
View this message in context: 
http://www.nabble.com/Would-you-mind-explain-such-a-code---tp25377949p25377949.html
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to