Polymorphic Type Inference Program in caml