A fold_left
(or a fold_right
) is a very common case, with a very simple data flow. Using a common function make your intent very clear. Contrarily, if you write your own function by hand, you could implement a much more complex data flow. Consequently, you require more effort from your reader to identify the fact that you are just reimplementing a fold.
14 Likes