def apply
import bendlib-kernel-list@1.0.0.0/list.bend as Listimport Base
29# Apply a list of adjacent swaps, left to right.
30def apply(-A: Data, +steps: List<&2, Nat>, xs: List<&2, A>) -> List<&2, A>:
31 match steps:
32 case Nil{}:
33 xs
34 case +i <> rest:
35 apply(A, rest, swap_at(A, i, xs))