Simple type inference for structural polymorphism.