Plus #1 and #3 (not in-place) can be expressed through #2 and likewise #1 and #2 can be expressed through #3 (not in place, especially if it's an iterator).
So the naming is unhelpful and the only operation implemented is the least useful random collection operation. That's not very good.
Finally you don't need to pull a whole library for that, it's a 3 lines extension.
I don't see the confusion. #1 would be .random(), #2 would be .random(Int), and #3 would be .shuffle() with both mutating and non-mutating versions.
> So the naming is unhelpful and the only operation implemented is the least useful random collection operation.
There could be all three of these methods, which you could use depending on your needs.
> Finally you don't need to pull a whole library for that, it's a 3 lines extension.
The purpose of a standard library is to make common things easy. At least one of these three functions are found in nearly all other languages' standard libraries I've ever used.
All three operations are random, naming something "random" provides no indication whether it's a random indexing or a random shuffling.
> There could be all three of these methods, which you could use depending on your needs.
Sure, but there isn't, and the one operation which is provided is the one you can't use as basic building blocks for the other two.
> The purpose of a standard library is to make common things easy. At least one of these three functions are found in nearly all other languages' standard libraries I've ever used.
Your point being? I'm not saying the operation is useless, I'm saying the naming is confusing and out of 3 possible operations using that name, the least useful one was selected.