Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

No, HM algorithm has terrible worst case complexity, but the worst cases don't correspond to programs humans write and generally it works perfectly in practice.


IIRC, the algorithm used by the ocaml implementation is guaranteed to be close to linear time as long as you dont have this sort of nested polymorphic lets.


Humans tend to surprise in what they wind up writing. All HM has to do is fail 5% of the time to be very annoying.


In my experience the failure rate is far below 5% for vanilla HM algorithm. I've never seem a pathological input in the wild that wasn't contrived specifically to test the typechecker.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: