
1 Jun
2011
1 Jun
'11
6:26 p.m.
On Wed, Jun 1, 2011 at 3:28 AM, Daniel Fischer < daniel.is.fischer@googlemail.com> wrote:
On Wednesday 01 June 2011 12:25:06, Adrien Haxaire wrote:
On Wed, 01 Jun 2011 11:46:36 +0200, Henning Thielemann wrote:
Really, you can write foldr in terms of foldl? So far I was glad I could manage the opposite direction. foldr (++) (repeat "No way! ")
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