[Haskell-cafe] *GROUP HUG*

Tom Murphy amindfv at gmail.com
Thu Jun 2 01:12:37 CEST 2011


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



More information about the Haskell-Cafe mailing list