fold

inline fun <T, R> Buffer<T>.fold(initial: R, operation: (acc: R, T) -> R): R

Fold given buffer according to operation