In the general case, => A is a parameter of a name of type A. This means that the parameter will be evaluated only when and when (and each time) it is used in the body of the function. Thus, f is a parameter of a name whose type is a function that takes a String and returns a function from Request[AnyContent] to a Result . The following is an example of how to evaluate by the name parameter:
scala> def twice[A](a: =>A) = (a,a) twice: [A](a: => A)(A, A) scala> var i = 0 i: Int = 0 scala> twice { | i += 1 | i | } res0: (Int, Int) = (1,2)
source share