def shuffle_step
import bend-collections-laws-math@1.0.0.0/src/math/random/rand.bend as Randimport Base
import bend-collections-laws-math@1.0.0.0/src/math/u64.bend as W
293# swap element i with a uniform j < n = i + 1
294def shuffle_step(~A: Data, ~S: Data, ~next: S -> W.U64 & S, +i: Nat, +n: W.U64, st: List<&2, A> & S) -> List<&2, A> & S:
295 (xs, s) = st
296 swap_at(A, S, xs, i, uint64n(~S, ~next, s, n))