Add compare implementation for retypes