Do you want BuboFlash to help you learning these things? Or do you want to add or correct something? Click here to log in or create user.



#scala
by adding the η-expansion postfix operator (η is pronounced "eta"), we can turn the method into a function value.
If you want to change selection, open document below and click on "Move attachment"

tpolecat
with `_' if you want to treat it as a partially applied function val f = add1 ^ Note also the type of add1, which doesn't look normal; you can't declare a variable of type (n: Int)Int. Methods are not values. However, <span>by adding the η-expansion postfix operator (η is pronounced "eta"), we can turn the method into a function value. Note the type of f. scala> val f = add1 _ f: Int => Int = scala> f(3) res0: Int = 4 The effect of _ is to perform the equivalent of the following: we construct a Function1 in


Summary

statusnot read reprioritisations
last reprioritisation on suggested re-reading day
started reading on finished reading on

Details



Discussion

Do you want to join discussion? Click here to log in or create user.