python from cytoolz import accumulate, curry @curry def add(x, y): return x + y data = [1, 2, 3, 4, 5] result = list(accumulate(add(), data))