--[[
	Creates a new binding from this one with the given mapping.
]]

function bindingPrototype:map(valueTransform)
	if config.typeChecks then
		assert(typeof(valueTransform) == "function", "Bad arg #1 to binding:map: expected function")
	end

	local binding = Binding.create(valueTransform(self:getValue()))

	binding[InternalData].valueTransform = valueTransform
	binding[InternalData].upstreamBinding = self

	return binding
end
