accumulate package:vector-sized

O(m+n) For each pair (i,b) from the vector of pairs, replace the vector element a at position i by f a b.
accumulate (+) <5,9,2> <(2,4),(1,6),(0,3),(1,7)> = <5+3, 9+6+7, 2+4>
O(m+n) For each pair (i,b) from the vector of pairs, replace the vector element a at position i by f a b.
accumulate (+) <5,9,2> <(2,4),(1,6),(0,3),(1,7)> = <5+3, 9+6+7, 2+4>
O(m+n) For each pair (i,b) from the vector of pairs, replace the vector element a at position i by f a b.
accumulate (+) <5,9,2> <(2,4),(1,6),(0,3),(1,7)> = <5+3, 9+6+7, 2+4>
O(m+n) For each pair (i,b) from the vector of pairs, replace the vector element a at position i by f a b.
accumulate (+) <5,9,2> <(2,4),(1,6),(0,3),(1,7)> = <5+3, 9+6+7, 2+4>
O(m+n) For each index i from the index vector and the corresponding value b from the the value vector, replace the element of the initial vector at position i by f a b.
accumulate_ (+) <5,9,2> <2,1,0,1> <4,6,3,7> = <5+3, 9+6+7, 2+4>
This function is useful for instances of Vector that cannot store pairs. Otherwise, accumulate is probably more convenient:
accumulate_ f as is bs = accumulate f as (zip is bs)
O(m+n) For each index i from the index vector and the corresponding value b from the the value vector, replace the element of the initial vector at position i by f a b.
accumulate_ (+) <5,9,2> <2,1,0,1> <4,6,3,7> = <5+3, 9+6+7, 2+4>
This function is useful for instances of Vector that cannot store pairs. Otherwise, accumulate is probably more convenient:
accumulate_ f as is bs = accumulate f as (zip is bs)
O(m+n) For each index i from the index vector and the corresponding value b from the the value vector, replace the element of the initial vector at position i by f a b.
accumulate_ (+) <5,9,2> <2,1,0,1> <4,6,3,7> = <5+3, 9+6+7, 2+4>
This function is useful for instances of Vector that cannot store pairs. Otherwise, accumulate is probably more convenient:
accumulate_ f as is bs = accumulate f as (zip is bs)
O(m+n) For each index i from the index vector and the corresponding value b from the the value vector, replace the element of the initial vector at position i by f a b.
accumulate_ (+) <5,9,2> <2,1,0,1> <4,6,3,7> = <5+3, 9+6+7, 2+4>
This function is useful for instances of Vector that cannot store pairs. Otherwise, accumulate is probably more convenient:
accumulate_ f as is bs = accumulate f as (zip is bs)
O(m+n) For each index i from the index vector and the corresponding value b from the the value vector, replace the element of the initial vector at position i by f a b.
accumulate_ (+) <5,9,2> <2,1,0,1> <4,6,3,7> = <5+3, 9+6+7, 2+4>
This function is useful for instances of Vector that cannot store pairs. Otherwise, accumulate is probably more convenient:
accumulate_ f as is bs = accumulate f as (zip is bs)
Same as accumulate but without bounds checking.
Same as accumulate_ but without bounds checking.
Same as accumulate_ but without bounds checking.
Same as accumulate but without bounds checking.
Same as accumulate_ but without bounds checking.
Same as accumulate but without bounds checking.
Same as accumulate_ but without bounds checking.
Same as accumulate but without bounds checking.
Same as accumulate_ but without bounds checking.