-- uniqby fn xs — keep the first element whose key (computed by `fn`) hasn't been seen.
-- Mirrors `unq` (which dedupes primitives) but lets you dedupe by a derived key.
-- Key function: parity (returns 0 or 1 as text).
par n:n>t;r=mod n 2;str r
-- Dedup numbers by parity (keep first even, first odd).
by-parity ns:L n>L n;uniqby par ns
-- HOF dispatch goes through the tree-bridge on every engine (PR 3b).
-- engine-skip: jit
-- run: by-parity [1,3,2,4,5,6]
-- out: [1, 2]