This variant allows the user to supply a function that transforms
the constructor name to a prettier rendering. It is important that
the transformation function generates a unique output for each
input. For example, simply converting the string to all lower case
is not acceptable, because then FooBar and Foobar would be
indistinguishable.