Named Tuples - field updating

Yes, that looks good! My version found indices instead, e.g.

  type LabelIndex[Ns <: Tuple, L <: LabelVal, N <: Int] <: Int = Ns match
    case EmptyTuple => -1
    case L *: _     => N
    case _ *: tail  => LabelIndex[tail, L, N+1]

(called with 0 in the last position when starting). But I ran into trouble when trying to use the indices because rebuilding the tuple with *: is expensive, at which point it doesn’t matter if you can

inline constValue[LabelIndex[Ns, L, 0]] match =>
  case -1 => t *: copyRestImpl(...)
  case n => u(n) *: copyRestImpl(...)

(LabelVal is an alias to String & Singleton, which I use for manipulating tuple names in my code so that the compiler will reject, early, some of the more nonsensical things.)

Anyway, given type flexibility the match type turned out to be the easy part and the performant implementation the hard part, in my hands, and that is where I gave up.