seq.shuffle(); // copy to a new seq and shuffle it
seq.shuffle$(); // shuffle the original seq
These two methods should have the exact same signature. So using two different names is necessary. I'm not particularly fond of introducing $ as a substitute for !. That convention is not existent in Java, and is not at all obvious to anyone who hasn't studied a functional language.I would probably solve this by simply making shuffle always in place, and add a copy constructor and/or copy method:
// Copy and shuffle.
(new Seq(seq)).shuffle();
seq.copy().shuffle();
// Shuffle in-place.
seq.shuffle();