Bas van Dijk wrote:
On Wed, Nov 5, 2008 at 12:43 AM, Bas van Dijk <[EMAIL PROTECTED]> wrote:
2008/11/5 Daryoush Mehrtash <[EMAIL PROTECTED]>:
Are there cases (function or list) where the result of foldl (or foldr)would
be different that foldl' (or foldr')?
Maybe this wiki article I wrote some time ago will answer your question:

http://haskell.org/haskellwiki/Foldr_Foldl_Foldl'

Oops that link should be:

http://haskell.org/haskellwiki/Foldr_Foldl_Foldl%27

I have an idea for the foldl diagram. If you rotate the RHS 90deg clockwise, it slopes the same way as the original list, but the 'f's are still rotated sideways to signify which their inputs are. That makes the relationship between imperative accumulator loops and foldl a bit clearer to me, as well as the relationship between the list and the recursion structure.

--
src/
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to