In Chapter 9 of Programming In Scala, there is an example method like this:
def twice(op: Double => Double, x: Double) = op(op(x))
The author said in the book:
The type of op in this example is Double => Double, which means it is a function that takes one Double as an argument and returns another Double.
I don't understand what is "Double => Double" here, in previous chapters, where "=>" appears only means function literal, and never wrote like this "Type => Type", because according to Scala function literal syntax definition, the right part of function literal is the function body, how can a function body be "Double" ?
Function
? (as inFunctionN
,Function1
, etc) – Bashemeth