accumulate package:nonempty-vector

O(m+n) For each pair (i,b) from the vector of pairs, replace the non-empty vector element a at position i by f a b.
>>> accumulate (+) (unsafeFromList [1..3]) (V.fromList [(2,10)])
[1,2,13]
>>> accumulate (+) (unsafeFromList [1..3]) V.empty
[1,2,3]
O(m+min(n1,n2)) For each index i from the index vector and the corresponding value b from the the value vector, replace the element of the initial non-empty vector at position i by f a b.
>>> accumulate_ (+) (unsafeFromList [1..3]) (V.fromList [2]) (V.fromList [10])
[1,2,13]
>>> accumulate_ (+) (unsafeFromList [1..3]) V.empty V.empty
[1,2,3]
Same as accumulate but without bounds checking.
Same as accumulate_ but without bounds checking.