O(1)
function arrayUpdate<A> input array<A> arr; input Integer index; input A newValue; output array<A> newArray "same as the input array; used for folding"; end arrayUpdate;