6 ms·
: T is consistent with values, it's the way of saying a thing has a type. It makes for much more consistency when refactoring a function, and (at least in Scala
by lmm 11y ago
: T is consistent with values, it's the way of saying a thing has a type. It makes for much more consistency when refactoring a function, and (at least in Scala) supports the Uniform Access Principle style.
def lock(...): T = ...
val lockResult = lock(...): T
In Scala at least "=> T" is the syntax for a lazy T (i.e. a function of no arguments that returns T), and so your "hello" reads like a function that returns a lazy String.