# shuffle

`import { shuffle } from "destack:math";`

Shuffle vector lanes.

Rearranges elements from two input vectors according to a mask.
Each element in the result comes from either `a` or `b` as specified by the mask.

```ds title="shuffle"
export declare function shuffle<T, const N: usize, const M: usize, const Pattern: [uint32; M]>(a: Vector<T, N>, b: Vector<T, N>): Vector<T, M>
```

[language/library/src/math/vector.ds:42:45](https://github.com/destack-sh/destack/blob/main/language/library/src/math/vector.ds#L42-L45)
