function BrioUtils.flatten(V)local S={}local W={}for V,A in pairs(V)do if Brio.isBrio(A)then if A:IsDead()then return Brio.DEAD else table.insert(W,A)S[V]=A:GetValue()end else S[V]=A end end return BrioUtils.first(W,S)end
--[=[
	Given a list of brios of brios, flattens that list into a brio with
	just one T value.

	@param brioTable { any: Brio<Brio<T> | T>}
	@return Brio<{T}>
]=]
function BrioUtils.flatten(brioTable)
	local newValue = {}
	local brios = {}

	for key, brio in pairs(brioTable) do
		if Brio.isBrio(brio) then
			if brio:IsDead() then
				return Brio.DEAD
			else
				table.insert(brios, brio)
				newValue[key] = brio:GetValue()
			end
		else
			newValue[key] = brio
		end
	end

	return BrioUtils.first(brios, newValue)
end
