4 ms·
Languages with local type inference can sometimes omit type annotations from lambdas, if that lambda is being returned or passed as an argument to another funct
by ufo 10mo ago
Languages with local type inference can sometimes omit type annotations from lambdas, if that lambda is being returned or passed as an argument to another function. In those situations we know what the expected type of the argument should be and can omit it.
- Quekid5 10mo agoYeah, that's true and that's a good convenience even if it's not full inference. In the case of Scala, the parameter types may often be required, but at least the return type can be omitted, so there's that.