News for hackers. Stuff that matters.
Re:Implementing and Understanding Type Classes (2014) by jahewson on Saturday April 28, 2018 @05:13PM (#16949438)
> Hindley-Milner has problems with inferring types in the presence of polymorphic recursion, and a user provided type annotation is usually necessary.

Strictly speaking Hindley-Milner never requires type annotations. It can infer the type of any well-formed expression. You must be thinking of some extension of HM (of which there are many).

Re:Implementing and Understanding Type Classes (2014) by calebh on Saturday April 28, 2018 @05:40PM (#16949548)
Hindley-Milner monomorphizes the type of a function inside the body of the function, so if you make a recursive call on a different type the type checker will complain. There are many subtle "gotchas" with type inference that are often not encountered by most programmers. Unless you've implemented a type inference engine yourself, you probably don't know about these sort of restrictions.

Here is an example of the type error (I used the datatype from the Wikipedia article on polymorphic recursion): https://repl.it/@CalebHelbling/PolymorphicRecursionError