The question of how to ensure that one type family is the inverse of another comes up once in a while. Here some concrete code.