Low-level vector update helper used for efficient code generation.
In-place update of the element at index i via f, wrapping Array.modify
so the underlying swap-with-placeholder ownership transfer survives codegen.
Calling xs.set i (f xs[i]) forces a lean_inc on the borrowed entry and
loses uniqueness on nested-array shapes (e.g. matrix rows); modify avoids
that copy when xs is uniquely owned.
Instances For
A left fold of per-index modifys over a list of Fin n indices leaves
index r untouched when r is not among the folded indices. The backing engine
for the in-place indexed row scatter (Matrix.mapRowsIdx).
Reading index r of a Fin.foldl of per-index modifys yields g r
applied to the original entry — every index is visited exactly once. This is the
in-place (no intermediate List.finRange allocation) scatter form.