
Scala Tutorials Part #2 – Type Inference and Types in Scala – Madusudanan - madhusudhan000
http://madusudanan.com/blog/scala-tutorials-part-2-type-inference-in-scala/#kudo
======
nv-vn
This article kind of ignored the difference between local and global type
inference when grouping languages with inferred types into a list, even though
the concepts are entirely different (both in implementation details and in the
way they affect use of the language). For example, having local type inference
makes it impossible to share a syntax between functions and variables, plus
the process of 'inferring' these types simply involves looking up the type of
the expression by looking at the functions/values/operators used (which
already have a known type at that point). With global type inference, looking
at a term alone will not give you all the information that you need because
there's no annotated information about what the types of arguments to your
function will be. The difference means that local type inference is just
taking information from the right side and placing it on the left, while
global inference is a recursive process of unifying information that is not
necessarily connected in a clear way.

~~~
madhusudhan000
Yeah, I sort of skipped over that detail, thanks for pointing it out, ill
include it in the post.

