>
> 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

Reply via email to