Re: [Haskell-cafe] foldl vs foldl'

2008-11-09 Thread Simon Richard Clarkstone
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

Re: [Haskell-cafe] foldl vs foldl'

2008-11-05 Thread Nicolas Pouillard
Excerpts from daniel.is.fischer's message of Wed Nov 05 00:37:47 +0100 2008: Am Mittwoch, 5. November 2008 00:08 schrieb Daryoush Mehrtash: Are there cases (function or list) where the result of foldl (or foldr)would be different that foldl' (or foldr')? thanks, daryoush Simple

Re: [Haskell-cafe] foldl vs foldl'

2008-11-05 Thread Daryoush Mehrtash
Lets assume we don't have undefined in the list, are there functions (or properties in the function) that would cause foldl to have different results than foldl'? daryoush On Tue, Nov 4, 2008 at 3:37 PM, Daniel Fischer [EMAIL PROTECTED]wrote: Am Mittwoch, 5. November 2008 00:08 schrieb

Re: [Haskell-cafe] foldl vs foldl'

2008-11-05 Thread Jonathan Cast
On Wed, 2008-11-05 at 10:01 -0800, Daryoush Mehrtash wrote: Lets assume we don't have undefined in the list, are there functions (or properties in the function) that would cause foldl to have different results than foldl'? If the function is partial on some elements of the list. (3 /), for

Re: [Haskell-cafe] foldl vs foldl'

2008-11-05 Thread Derek Elkins
On Wed, 2008-11-05 at 10:01 -0800, Daryoush Mehrtash wrote: Lets assume we don't have undefined in the list, are there functions (or properties in the function) that would cause foldl to have different results than foldl'? The only difference in the definition of foldl and foldl' is a seq so

[Haskell-cafe] foldl vs foldl'

2008-11-04 Thread Daryoush Mehrtash
Are there cases (function or list) where the result of foldl (or foldr)would be different that foldl' (or foldr')? thanks, daryoush ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] foldl vs foldl'

2008-11-04 Thread Derek Elkins
On Tue, 2008-11-04 at 15:08 -0800, Daryoush Mehrtash wrote: Are there cases (function or list) where the result of foldl (or foldr)would be different that foldl' (or foldr')? There is no foldr'. And yes, foldl and foldl' are different functions and thus return different results on some

Re: [Haskell-cafe] foldl vs foldl'

2008-11-04 Thread Daniel Fischer
Am Mittwoch, 5. November 2008 00:08 schrieb Daryoush Mehrtash: Are there cases (function or list) where the result of foldl (or foldr)would be different that foldl' (or foldr')? thanks, daryoush Simple example: import Data.List weird :: Int - Int - Int weird _ 0 = 0 weird x y = x*y list

Re: [Haskell-cafe] foldl vs foldl'

2008-11-04 Thread Bas van Dijk
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' regards,

Re: [Haskell-cafe] foldl vs foldl'

2008-11-04 Thread Bas van Dijk
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