Higher-order Functions

Higher-order Functions
Scala allows the definition of higher-order functions. These are functions that take other functions as parameters, or whose result is a function. Here is a function apply which takes another function f and a value v and applies function f to v:
def apply(f: Int => String, v: Int) = f(v)
Note: methods are automatically coerced to functions if the context requires this.
Read more: Scala documentation

Следи за CodeGalaxy

Мобильное приложение Beta

Get it on Google Play
Обратная Связь
Продолжайте изучать
сниппеты с Scala
Cosmo
Зарегистрируйся сейчас
или Подпишись на будущие тесты