any mix of above (value.modify(_.field.listField.each.anotherListField.at(10).mapField.at(key).optionField.each.when[ParticularSubtype].anotherField).setTo(nestedValue))
It would require a lot of effort to have it in stdlib, since it requires several types to handle all of the above (multiple traits), to correctly represent whether the nested value is always present, is an option (it might be present or not, depending on runtime types) or collection (there might be multiple values). And people would most likely not agree on API.
Meanwhile existing libraries solve all of that, let you pick whatever API you prefer, and generate a little overhead (which built-in support probably would not eliminate completely).
I don’t recall anyone actually writing up a full proposal, though (a pre-SIP or SIP). With full syntax and semantics (and consideration of possible alternatives), consideration of corner cases, and so on.
I personally think that Java’s approach has a lot of merit. There have been many times where I want to conditionally modify the field along with other modifications. Usually I end up doing two copy() in a row, which is inefficient.
What if we adopt their approach, introduce copyWith or similarly named method accepting a block that introduces all the fields into the local scope, then produces a copy with all modications?
If we do this, then the OP’s example is just a special case of that.
Maybe it’s possible to create something like a CopyView so you can chain maps/copies and then just invoke .concrete to get a final single copy that handles the chaining under the hood.