[Haskell-cafe] Re: [Haskell-beginners] folds -- help!

2009-03-14 Thread Adrian Neumann
That's why I said for appropriate g and f. But I see that my wording was misleading. However you can say: foldl' oplus alpha bs =(foldr f id bs) alpha where f a g = \alpha - g (alpha `oplus` a) foldr' oplus alpha bs = (foldl f id bs) alpha where f g a = \alpha - g (a `oplus`

Re: [Haskell-cafe] Re: [Haskell-beginners] folds -- help!

2009-03-14 Thread John Dorsey
Adrian, That's why I said for appropriate g and f. But I see that my wording was misleading. Thanks for following up! I had thought you were arguing that foldl and foldr were easily and intuitively interchangeable; they're surely not so for beginners. Now I think you're arguing that given