Is the following statement equivalent?
foldr (++) [ ] = foldl (++) [ ]
I know that foldr (+) 0 = fold (+) 0 is equivalent and for the operator (-) it's not, but how about the (++) operator ?
I think the result is a list with the same content but in another order. Is the order of the list relevant?


EDIT: does not answer the question (sorry)
foldl :: (b -> a -> b) -> b -> [a] -> bfoldr :: (a -> b -> b) -> b -> [a] -> b(+)is commutative, i.e. produces the same result if the arguments order is switched. E.g.1+2is the same as2+1.Look at the type signature of
foldlandfoldr.foldltakes a function(b->a->b)whose second argument is an element from the list.On the other hand,
foldrtakes a function(a->b->b)whose first argument is an element from the list.With
foldl, there is an accumulation on the left (first argument). Withfoldr, there is an accumulation on the right (second argument).foldlfolds from left to right,foldrfolds from right to left.Technically, it's more complicated than that. For more information, see https://wiki.haskell.org/Foldr_Foldl_Foldl'