2 ms·
1. Only for unconstrained parametric polymorphism. For constrained parametric polymorphism, ML requires functors (don't get me wrong, I think ML functors are br
by rbehrends 9y ago
1. Only for unconstrained parametric polymorphism. For constrained parametric polymorphism, ML requires functors (don't get me wrong, I think ML functors are brilliant, but they do require you to be rather explicit about your typing).
2. I wouldn't say that it's without problems even for unconstrained parametric polymorphism. Consider the value restriction [1] and the fact that if you add subtyping to the mix (as in OCaml), you're getting some really non-trivial issues (as Scala found out the hard way).
[1] http://mlton.org/ValueRestriction http://mlton.org/ValueRestriction
- wtetzner 9y agoYes, subtyping makes everything more complicated. I think there was a paper about type inference for subtyping posted on HN a while back, but I don't remember much about it.