@arialdo First, use formal methods and the implementation to prove the output is always a permutation of the input.
Then, shuffle a small list a large number of times and verify the distribution is uniform. Other, more complex tests of random number generators can also be adapted and used. Since, for any finite input, repeated calls to shuffle is effectively a RNG.
Might be able to use parametricity to extend finite results to infinite lists?
I'm playing with #Rust.
So far, I'm more disappointed than excited.
I find it schizophrenic.
It aspires to be a high level language like #Haskell, with traits, immutability, HOF, all the things you expect from a modern language.
All brilliant.
But then, its low-level, system language nature - borrowing, ownership, move, stack, heap, scopes, Box, dyn, size of variables - get in the way, no matter the level of abstraction you are operating, and on top of a C-style oldish syntax.