=> String => Request[AnyContent] => Result
easier to read with the addition of partners:
=> (String => (Request[AnyContent] => Result))
You can try this in REPL. For instance:
scala> def foo(f: => String => Int => Char): Char = f("abcdefgh")(4) foo: (f: => String => (Int => Char))Char
In this example, f is the nullary function parameter to be called by name, which returns the function (let's call this function g). g is a function that takes a String parameter and returns another function (h). h is a function that takes an Int parameter and returns Char.
Call example:
scala> foo { s: String => { i: Int => s.charAt(i) } } res0: Char = e
Pass through each expression in the body of the method, as it appreciated:
f- Type:
String => (Int => Char) - Value:
{ s: String => { i: Int => s.charAt(i) } }
f("abcdefgh")- Type:
Int => Char - Value:
{ i: Int => "abcdefgh".charAt(i) }
f("abcdefgh")(4)
source share