Principal type-schemes for functional programs