-- -*- M2-comint -*- hash: 7493259371256123048

i1 : accumulate(plus, {0,1,2,3,4,5})

o1 = {1, 3, 6, 10, 15}

o1 : List

i2 : accumulate(concatenate, {a,b,c,d,e})

o2 = {ab, abc, abcd, abcde}

o2 : List

i3 : accumulate((i,j) -> i|j|i, {"a","b","c","d","e"})

o3 = {aba, abacaba, abacabadabacaba, abacabadabacabaeabacabadabacaba}

o3 : List

i4 : accumulate(plus, 0, {1,2,3,4,5})

o4 = {1, 3, 6, 10, 15}

o4 : List

i5 : accumulate((x, y) -> x^y, 2, {3,2,1,2})

o5 = {8, 64, 64, 4096}

o5 : List

i6 : accumulate({a,b,c,d,e}, concatenate)

o6 = {abcde, bcde, cde, de}

o6 : List

i7 : accumulate({a,b,c,d}, e, concatenate)

o7 = {abcde, bcde, cde, de}

o7 : List

i8 : accumulate({2,3,2,1}, 2, (x, y) -> x^y)

o8 = {512, 9, 2, 1}

o8 : List

i9 : iter = accumulate(identity, "abcde")

o9 = iter

o9 : Iterator

i10 : next iter

o10 = (a, b)

o10 : Sequence

i11 : next iter

o11 = ((a, b), c)

o11 : Sequence

i12 : next iter

o12 = (((a, b), c), d)

o12 : Sequence

i13 : fold({2,3,2,1}, 2, (x,y) -> x^y)

o13 = 512

i14 : 
