Fold with continues takes a left associative O(n^2) into a right associative O(n).