I think there is not yet a shuffle function in a general purpose library (I did find one in quickcheck, but it uses the Gen monad). I'm thinking something like this:
shuffle :: Array a -> Effect (Array a)
Would it make sense to add it here? Would you like a PR (it might add some dependencies though, notably purescript-arrays)? I think a basic implementation using the Yates-Fisher algorithm in the ST monad would be the most performant.
I think there is not yet a
shufflefunction in a general purpose library (I did find one inquickcheck, but it uses theGenmonad). I'm thinking something like this:Would it make sense to add it here? Would you like a PR (it might add some dependencies though, notably purescript-arrays)? I think a basic implementation using the Yates-Fisher algorithm in the ST monad would be the most performant.