Hacker News new | ask | show | jobs
by exDM69 4170 days ago
In a classic Hindley-Milner type inference algorithm, you can't have a function "add(int, int) -> int" and "add(float, float) -> float". E.g. in Haskell, you'd need a type class for this.

Modern functional programming languages use a type inference algorithm more sophisticated than the original H-M algorithm which are more flexible than the original algorithm. The link you gave as an example is Haskell with a handful of language extensions related to the type checker - something entirely different to the H-M algorithm.

There can be other ways of implementing a similar type checker in a different manner, this was just a fun idea I came up with.