function t.map(g,r)assert(t.callback(g))assert(t.callback(r))local J=t.keys(g)local Q=t.values(r)return function(g)local r,O=J(g)if not r then return false,O or""end local p,H=Q(g)if not p then return false,H or""end return true end end

function t.map(keyCheck, valueCheck)
	assert(t.callback(keyCheck))
	assert(t.callback(valueCheck))
	local keyChecker = t.keys(keyCheck)
	local valueChecker = t.values(valueCheck)

	return function(value)
		local keySuccess, keyErr = keyChecker(value)
		if not keySuccess then
			return false, keyErr or ""
		end

		local valueSuccess, valueErr = valueChecker(value)
		if not valueSuccess then
			return false, valueErr or ""
		end

		return true
	end
end
