Represent pair codec in terms of generic codec