柯里化是把接收多个参数的函数变成接收一个单一参数的函数,并返回余下参数的新函数。

    def add(x:Int, y:Int): Int = x+y
    def curryAdd(x:Int)(y:Int):Int = x+y

    val one = curryAdd(1)_
    one(2)

    柯里化实现过程:
    def first(x:Int):Int=>Int = {(y:Int) => x+y}
    val second = first(1)
    val res = second(2)