ANN: TupleShuffling: shuffling of tuples and generating random permutation tuples

TupleShuffling is being registered. Use it when:

  • There’s a tuple and you want to shuffle its elements. So like shuffle from the standard library, but for tuples instead of for arrays
  • You want a random permutation of static size. So like randperm from the standard library, but for tuples instead of for arrays.

Suggestions welcome, v1.0.0 isn’t set in stone until the registration is over, in three days.

One thing I’m mulling over is whether to make some arguments optional, especially the RNG. Perhaps I could introduce Random as a dependency and make Random.default_rng() the default PRNG, but that function doesn’t seem to be public? What is the usual practice?

Should this be a package or a PR?

1 Like

Can this be merged with TupleTools.jl, as they seem to have similar goals?

You mean a PR onto Julia’s Base and/or Random? That could make sense, but it’s a separate issue that I’ll only get back to once I’m done with lots of other stuff, including other PRs onto Julia’s Base. I want this in a user package anyway because I want the functionality to be usable with a released version of Julia.

This is a separate issue, and one I don’t indent to work on unless the maintainer bumps the Julia compat to something more reasonable (they currently still support v1.0 as far as I understand). In any case it’s good to have self-contained functionality in separate packages in the interest of minimizing deps, compilation cost, etc. In fact, now I plan to split out one or two packages out from TupleShuffling into stand-alone packages before registering TupleShuffling.