--[[
	Performs a left-fold of the list with the given initial value and callback.
]]

function Functional.Fold(list, initial, callback)
	local accum = initial

	for key = 1, #list do
		accum = callback(accum, list[key], key)
	end

	return accum
end
