Sorting a collection by variant can be useful. For example, to implement `PartialEq` in a simple way.