--[[ @brief Produces a cumulative sum along a table.
     @details The passed-in table will be mutated.
     @example Accumulate({1, 2, 3}) = {1, 3, 6}.
     @param t The table to accumulate.
--]]

function module.Accumulate(t)
	local s = 0;
	for i, v in pairs(t) do
		s = s + t[i];
		t[i] = s;
	end
	return t;
end
