5 ms·
Scala almost has this. You can declare a function with "implicit" arguments, and the compiler will look for something that matches the requirements in each call
by gliese1337 8y ago
Scala almost has this. You can declare a function with "implicit" arguments, and the compiler will look for something that matches the requirements in each calling scope and insert it automatically.
It does not, however, automatically infer the implicit parameters based on usage of implicit arguments in the function body, though.
- adrice727 8y agoDotty is moving in this direction with Implicit Function Types. https://dotty.epfl.ch/docs/reference/implicit-function-types.html https://dotty.epfl.ch/docs/reference/implicit-function-types... https://www.youtube.com/watch?v=YXDm3WHZT5g&feature=youtu.be https://www.youtube.com/watch?v=YXDm3WHZT5g&feature=youtu.be