3 ms·
Definitely. I really like Haskell's type inference, but have always been concerned about issues like those raised in: http://www.codecommit.com/blog/scala/unive
by closure 16y ago
Definitely. I really like Haskell's type inference, but have always been concerned about issues like those raised in: http://www.codecommit.com/blog/scala/universal-type-inference-is-a-bad-thing http://www.codecommit.com/blog/scala/universal-type-inferenc...
- alextgordon 16y agoI find it very difficult to believe that a large source of errors in ML programs are caused by programmers forgetting to annotate type information on top level functions.
- Dn_Ab 16y agoScala does that because ad hoc polymorphism doesnt resolve well with hindley milner type inference. F# also has this limitation and they get some of the way around this with a strict vertical projects file layout. The scope of its type inference is a middle ground between Scala and Ocaml which I think is a nice optimum, you leave most things untyped except the overloads which can't be determined so that the eager generalization you encounter in ocaml is less of a problem there too. The price in project layout is quite steep though but like in all things you train your self around it. Plus with an IDE in Scala (or F#) you can just hover for the types.