j
k
j a
j l
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
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!"
Back to the thread
Back to the list