Implemented type inference for first-class polymorphism.