First of all, the situation in Scala is quite different from the situation in Haskell, because the OO language and type-output in an object-oriented setup are a little more complicated.
The only OO language I know that is suitable for full type inference is OCaml. OCaml does this by extensively using structural typing (the assumed type o in let fo = o.foo 42 is βAn object that has a method foo that takes an int as an argument,β and the return type is βall return type o.foo is ", which is the only useful type for output here).
However, Scala has many additional features (overloading, implicit conversions) that interfere with the OCaml approach and make it impossible to fully infer a global type.
source share