Re:Advanced programming languages (2009)
by dsacco on Sunday June 19, 2016 @02:41PM
(#11934042)
Can you expand on this for someone who is not familiar with Hindley-Milner typing?
[ Parent
| on HN ]
Re:Advanced programming languages (2009)
by premium-concern on Sunday June 19, 2016 @05:21PM
(#11934733)
Hindley-Milner means that you – unlike Scala – don't need to provide any type annotations at all as they can all be inferred.
This comes at a steep price, as HM-inferable typesystems are very limited, and most languages have in fact a typesystem that might be based on what HM can infer, but have extensions that require type annotations.
In the end Scala's requirement to annotate input parameters is not a big deal, as this only enforces what Haskell/Ocaml/... consider to be best practice anyway.
> In the end Scala's requirement to annotate input parameters is not a big deal, as this only enforces what Haskell/Ocaml/... consider to be best practice anyway.
It's a huge deal. I always write type signatures once I know what they are, but a lot of the time I get the compiler to infer them for me which saves significant headaches.