News for hackers. Stuff that matters.
Re:What is Hindley-Milner and why is it cool? (2008) by dtech on Sunday August 20, 2017 @03:45PM (#15059935)
> I wonder why you think so? The inferred types in a language like Haskell or OCaml are almost always exactly what the programmer would have written

I have no experience with ML-using languages but in Scala, which has inferior but still useful type inference, it is recommended to add explicit types to public functions/methods because otherwise, implementation details or errors might alter the signature.

Take for example:

    data Tree = Node Leaf Leaf | Leaf Integral
    makeEmptyTree x => Leaf x
I assume `Leaf` will be inferred as a type, while the programmer might have meant `Tree` to be the public API. (or vice-versa)
Re:What is Hindley-Milner and why is it cool? (2008) by catnaroek on Sunday August 20, 2017 @03:59PM (#15059988)
In ML, constructors aren't subtypes of a sum type. And that's a good thing.
Re:What is Hindley-Milner and why is it cool? (2008) by tel on Monday August 21, 2017 @07:00AM (#15063578)
This is largely to do with subtyping and it's well known that systems with user-defined nominal subtyping don't have good inference. Scala's inference is really in the middle: squarely better than C/Java and much worse than Haskell/OCaml.
Re:What is Hindley-Milner and why is it cool? (2008) by pdexter on Sunday August 20, 2017 @03:55PM (#15059973)
No, Leaf isn't a type.