[Haskell-cafe] foldl vs foldl'
Jonathan Cast
jonathanccast at fastmail.fm
Wed Nov 5 13:06:32 EST 2008
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 example, if the list contains 0.
If f is total over the elements of the list (whether the elements of the
list are partial or total) and f z /= _|_, then foldl' f z = foldl f z.
jcc
More information about the Haskell-Cafe
mailing list