> - I added a second function sample(), because it is a lot faster to take > some elements from an array than to shuffle the whole array and > slice it. This function can be removed if it is not wanted.
I have no opinion about whether this one is valuable enough to include in intarray, but I do feel like sample() is a vague name, and easily confused with marginally-related operations like TABLESAMPLE. Can we think of a more on-point name? Something like "random_subset" would be pretty clear, but it's also clunky. It's too late here for me to think of le mot juste...