Top "Type-inference" questions

Type inference is the process of inferring types for programs automatically, using rules defined by a type system.

OCaml explicit type signatures

In Haskell, it is considered good practice to explicitly declare the type signature of your functions, even though it can (…

syntax types ocaml type-inference
Why can't the C# constructor infer type?

Why is type inference not supported for constructors the way it is for generic methods? public class MyType<T&…

c# generics constructor type-inference
Why does this Java 8 program not compile?

This program compiles fine in Java 7 (or in Java 8 with -source 7), but fails to compile with Java 8: interface Iface<…

java generics type-inference java-8
Parametric polymorphism vs Ad-hoc polymorphism

I would like to understand the key difference between parametric polymorphism such as polymorphism of generic classes/functions in the …

java haskell types polymorphism type-inference
Functions with generic parameter types

I am trying to figure out how to define a function that works on multiple types of parameters (e.g. …

generics f# overloading type-inference typeclass
Inference variable has incompatible bounds. Java 8 Compiler Regression?

The following program compiles in Java 7 and in Eclipse Mars RC2 for Java 8: import java.util.List; public class Test { …

java compiler-errors java-8 type-inference
Scala String vs java.lang.String - type inference

In the REPL, I define a function. Note the return type. scala> def next(i: List[String]) = i.map {"0" + _} ::: …

string scala types type-inference
decltype vs auto

As I understand it, both decltype and auto will attempt to figure out what the type of something is. If …

c++ type-inference
Typed Generic Key Value Interface in Typescript

I have the following example Object: let foo: Foo = { 'key1': { default: 'foo', fn: (val:string) => val }, 'key2': { …

typescript generics type-inference typescript2.0 typescript-generics
Is there a downside to declaring variables with auto in C++?

It seems that auto was a fairly significant feature to be added in C++11 that seems to follow a lot …

c++ c++11 type-inference auto