The function hmap takes a functor f. All the recursive instances
in that functor are wrapped by an application of r. The argument to
hmap takes a function that transformes r occurrences into r'
occurrences, for every ix. In order to associate the index ix
with the correct family phi, the argument to hmap is additionally
parameterized by a witness of type phi ix.