http://stackoverflow.com/questions/6172004/writing-foldl-using-foldr/6172270#6172270
Thank Graham Hutton and Richard Bird. On Wed, Jun 1, 2011 at 7:12 PM, Tom Murphy <amin...@gmail.com> wrote: >> >> How about this: >> >> myFoldr :: (a -> b -> b) -> b -> [a] -> b >> myFoldr f z xs = foldl' (\s x v -> s (x `f` v)) id xs $ z >> >> Cheers, >> Ivan >> > > > Great! Now I really can say "Come on! It's fun! I can write foldr with foldl!" > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe@haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe