3 ms·
I think it depends on whether you have type inference or not. If you have type inference, then it's like unification. If you have explicit type annotations, i
by chubot 7y ago
I think it depends on whether you have type inference or not. If you have type inference, then it's like unification. If you have explicit type annotations, it's even simpler than that.
https://eli.thegreenplace.net/2018/unification/ https://eli.thegreenplace.net/2018/unification/
https://eli.thegreenplace.net/2018/type-inference/ https://eli.thegreenplace.net/2018/type-inference/
- seanmcdirmid 7y agoAnd if you want nominal sub typing, F-bounded generics, and some inference, things get really fun.
- rurban 7y agoNominal subtyping is trivial and unsafe. The fun starts with structural subtyping.
- seanmcdirmid 7y agoNominal sub typing is hard from trivial and calling it unsafe is non-sensical. Structural subtyping yields poor error messages and does not support encapsulation very well, especially if you also want separate compilation.