There's a Unique function to do this. I opted for a separate function rather than just relying on .copy, because I wanted the semantics to be clearer.