Generalize a Pair constructor