function BrioUtils.merge(b,W)assert(Brio.isBrio(b),"\078\111\116 \097 \098\114\105\111")assert(Brio.isBrio(W),"\078\111\116 \097 \098\114\105\111")if b:IsDead()or W:IsDead()then return Brio.DEAD end local s=b._values local D={}for b=1,s.n,1 do D[b]=s[b]end local j=W._values for b=1,j.n,1 do D[s.n+b]=j[b]end local m=Maid.new()local K=Brio.new(unpack(D,1,s.n+j.n))m:GiveTask((b:GetDiedSignal()):Connect(function()K:Kill()end))m:GiveTask((W:GetDiedSignal()):Connect(function()K:Kill()end))m:GiveTask((K:GetDiedSignal()):Connect(function()m:DoCleaning()end))return K end return BrioUtils
--[=[
	Merges the existing brio value with the other brio

	@param brio Brio<{T}>
	@param otherBrio Brio<{U}>
	@return Brio<{T | U}>
]=]
function BrioUtils.merge(brio, otherBrio)
	assert(Brio.isBrio(brio), "Not a brio")
	assert(Brio.isBrio(otherBrio), "Not a brio")

	if brio:IsDead() or otherBrio:IsDead() then
		return Brio.DEAD
	end

	local values = brio._values
	local current = {}
	for i = 1, values.n do
		current[i] = values[i]
	end

	local otherValues = otherBrio._values
	for i = 1, otherValues.n do
		current[values.n + i] = otherValues[i]
	end

	local maid = Maid.new()
	local newBrio = Brio.new(unpack(current, 1, values.n + otherValues.n))

	maid:GiveTask(brio:GetDiedSignal():Connect(function()
		newBrio:Kill()
	end))
	maid:GiveTask(otherBrio:GetDiedSignal():Connect(function()
		newBrio:Kill()
	end))

	maid:GiveTask(newBrio:GetDiedSignal():Connect(function()
		maid:DoCleaning()
	end))

	return newBrio
end

return BrioUtils
