Type inference refers to the automatic deduction of the type of an expression in a programming language. If some, but not all, type annotations are already present it is referred to as type reconstruction. The opposite operation of type inference is called type erasure.
It is a feature present in some strongly statically typed languages. It is often characteristic of, but not limited to, functional programming languages in general. Some languages that include type inference are ML, OCaml, Haskell, Scala, D, Clean, Opa and Go. It has lately been added (to some extent) to Visual Basic (starting with version 9.0), C# (starting with version 3.0) and C++11. It is also planned for Perl 6. The ability to infer types automatically makes many programming tasks easier, leaving the programmer free to omit type annotations while still permitting type checking.
Read more about Type Inference: Nontechnical Explanation, Technical Description, Example, Hindley–Milner Type Inference Algorithm
Famous quotes containing the words type and/or inference:
“Only that type of story deserves to be called moral that shows us that one has the power within oneself to act, out of the conviction that there is something better, even against ones own inclination.”
—Johann Wolfgang Von Goethe (17491832)
“I have heard that whoever loves is in no condition old. I have heard that whenever the name of man is spoken, the doctrine of immortality is announced; it cleaves to his constitution. The mode of it baffles our wit, and no whisper comes to us from the other side. But the inference from the working of intellect, hiving knowledge, hiving skill,at the end of life just ready to be born,affirms the inspirations of affection and of the moral sentiment.”
—Ralph Waldo Emerson (18031882)