Type variables are scoped to the top level definition, so by naming it you are forcing it to take on a single type for each invocation of the top level function.
Part of your confusion might also stem from believing that type variables enforce polymorphism. But they do not, type variables can be instantiated by any type during inference, whether general or concrete. To enforce polymorphism a type variable needs to be explicitly annotated as such, in this case with the type annotation 'a. ('a, string) => 'a
.