I remember seeing an SPJ talk where he mentioned that HM cannot be used in OO languages because of subtyping (he didn't explain this). But that obviously will never happen in Java. Someone correct me if I'm wrong. I don't know a lot about type inference.
The video was something like "classes but not as you know them" on channel 9 and was about type classes. The above was briefly mentioned in the last few minutes.
Edit: title was "classes, jim, but not as we know them"
Subtyping does wreck full inference, but limited (still somewhat useful) inference is still possible. Edward Kmett once summarised it as "it works great until the point where you really need it, when it breaks down."
2
u/csman11 Mar 10 '16
I remember seeing an SPJ talk where he mentioned that HM cannot be used in OO languages because of subtyping (he didn't explain this). But that obviously will never happen in Java. Someone correct me if I'm wrong. I don't know a lot about type inference.
The video was something like "classes but not as you know them" on channel 9 and was about type classes. The above was briefly mentioned in the last few minutes.
Edit: title was "classes, jim, but not as we know them"