3 ms·
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 H
by premium-concern 10y ago
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.
- tome 10y ago> 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.