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.



#functions #higher-order-functions #scala
def apply(f: Int => String, v: Int) = f(v)
If you want to change selection, open document below and click on "Move attachment"

Scala Higher-Order Functions
hose result is a function. For example in the following code, apply() function takes another function f and a value v and applies function f to v: object Test { def main(args: Array[String]) { println( apply( layout, 10) ) } <span>def apply(f: Int => String, v: Int) = f(v) def layout[A](x: A) = "[" + x.toString() + "]" } When the above code is compiled and executed, it produces the following result: C:/>scalac Test.scala C:/>


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.