Add contravariant for min and max

Hi, this PR added  contravariant for min and max mentioned in #494.