`foldl` vs `foldr`: matrix multiplication order

Ok, I just didn’t now what foldl/foldr are actually doing… I thought they fold a list from left or right but instead they seem to do (compare with example in doc):

julia> 2-(3-(4-(5)))
-2

julia> ((((2)-3)-4)-5)
-10

And since matrix product is associative the result ist the same.

1 Like