On Wed, Jun 1, 2011 at 3:28 AM, Daniel Fischer <span dir="ltr"><<a href="mailto:daniel.is.fischer@googlemail.com">daniel.is.fischer@googlemail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Wednesday 01 June 2011 12:25:06, Adrien Haxaire wrote:<br>
> On Wed, 01 Jun 2011 11:46:36 +0200, Henning Thielemann wrote:<br>
> > Really, you can write foldr in terms of foldl? So far I was glad I<br>
> > could<br>
> > manage the opposite direction.<br>
>foldr (++) (repeat "No way! ")<br></div></blockquote><div><br>How about this:<br><br>myFoldr :: (a -> b -> b) -> b -> [a] -> b<br>myFoldr f z xs = foldl' (\s x v -> s (x `f` v)) id xs $ z<br>
<br>Cheers,<br>Ivan<br></div></div>