This is feedback after considering A Plan for C++23 Ranges Disclosure: I voted in favor of this. It does not suggest work on views::maybe [P1255R6]. I'm fine with that priority.
T fold_left(Range&& r, T init, BinaryOperation op) { range_iterator_t<Range> b = begin(r); range_sentinel_t<Range> e = end(r); for (; b != e; ++b) { init = op(std::move(init), *b); } return init;
auto fold_right_loop(Range&& r, T init, BinaryOperation op) -> result_of<>{ range_iterator_t<Range> b = begin(r); range_sentinel_t<Range> e = end(r); for (; b != e; ++b) { init = op(std::move(init), *b); } return init;
result = op(op(op(op(op(op(op(op(z, a), b), c), d), e), f), g), h);
result = op(a, op(b, op(c, op(d, op(e, op(f, op(g, op(h, z))))))));
fold. It's an important question because short names are implicitly privileged. Programmers assume that the short name is the best one, and longer names indicate more specialized usage. This isn't true for C++, but not really on purpose. We did think that `map` was a good choice. The programmers should probably reach for `unordered_map` instead is unfortunate, but at this point unfixable.
Since C++ is strict, it would seem that left fold is the fold you mostly want, so it would be OK to call it fold.
Haskell, as lazy as it is, has issues with folds on ranges with indeterminate bounds. foldl vs foldr vs foldl' is a constant question. Foldr Foldl Foldl' Memory consumption of either stack or unevaluated expressions will surprise programmers.
But in the literature, fold is right fold. In the pure lambda calculus, right fold is strictly more expressive. Tail recursion is a subset of primitive recursion, and left is tail recursive while right is not. If we call our left fold, fold, we will confuse people.
Further, the forward iteration is somewhat balanced by the fact that the normal addition to a sequence is emplace_back or push_back, which means that left fold will tend to reverse lists if the operation is accumulation into a sequence, if for example the op were [](auto t){v.emplace_back(t);}.
More, we have started to introduce lazy features into the language, with coroutines. Although we won't get them soon, the C++ standard library should eventually have good lazy algorithms. It would be unfortunate if we have to teach that you can't use co_fold in place of fold because they are opposite, or that co_fold_left is how you spell the coroutine fold. [Note co_ prefixes are mildly sarcastic.]
C++ has a long history of setting defaults and realizing later that they are a problem.
I would much prefer we not make a choice about which fold is the fold, and just spell them as fold_left and fold_right.
We should all be able to get behind not calling it accumulate, even if we must live with transform.
fold operations and how they get extended if your type is a monoid. See Chris Di Bella's work such as A Concept Design for the Numeric Algorithms, although this rant suggests that algorithms that operate on different Concepts should have different names. Overloading on concepts with semantic differences can be confusing.