Properties of ML’s type system
Hindley-Milner type system/inference
- Universal parametric polymorphism
- No constrained polymorphism
- Except for equality types
- Only let-bound polymorphism
- Cannot pass polymorphic value that is polymorphic inside callee (cf. next slide)
Type inference yields principal type for expression
- Single most general type that can be inferred
Worse case time complexity: exponential
Average case complexity: linear