3 ms·
Yes. It works well as long as you have all the pieces and don’t have to worry about nominal subtypes.
by seanmcdirmid 9y ago
Yes. It works well as long as you have all the pieces and don’t have to worry about nominal subtypes.
- hliyan 9y agoCould you explain a little more about the complications of nominal subtypes?
- seanmcdirmid 9y agoI should have qualified that with the presence of type parameters (nominal subtypes without type parameters are still easy to deal with). Without subtypes, you only unify X and Y (so X = Y), where X and Y are trees with open variables. It turns out X < Y is much harder (semi unification rather than unification). It is basically equivalent to an alias analysis with imperative assignments (subtypes) and fields (type parameters).
- chillee 9y agoYou might have seen this already, but there was a thesis on combining subtyping and type inference here: http://www.cl.cam.ac.uk/~sd601/papers/mlsub-preprint.pdf http://www.cl.cam.ac.uk/~sd601/papers/mlsub-preprint.pdf
- seanmcdirmid 9y agoIt’s an active research area (less so now than in the 90s), so there is a lot of work on the subject. Nothing in production beyond ordersky’s color type system in scale (and that is completely local). Also, I believe the work you are citing above explores structural subtypes, not nominal ones.