Currying syntax in scala
问题 The syntax of currying in scala is for example def f(x: Int, b: Int) = x + y is def f(x: Int)(b: Int) = x + y And currying for sum to sum for given range a and b is def sum(f: Int => Int, a: Int, b: Int) = { ... } sum(x=>x, 3, 6) // outcome is 18 (3+4+5+6) is def sum(f: Int => Int): (Int, Int) => Int = { def sumF(a: Int, b: Int): Int = if (a > b) 0 else f(a) + sumF(a + 1, b) sumF } sum(x=>x)(3, 6) // outcome is 18 (3+4+5+6) But I don't understand why colon(:) exists between (f: Int => Int)