Scala中以下两个函数定义的区别是什么:
1) def sum(f: Int => Int)(a: Int, b: Int): Int = { <code removed> }
2) def sum(f: Int => Int, a: Int, b: Int): Int = { <code removed> }
?
SBT的控制台REPL为它们提供了不同的价值,因此看起来它们是否有所不同:
sum: (f: Int => Int, a: Int, b: Int)Int
sum: (f: Int => Int)(a: Int, b: Int)Int
functional-programming scala function higher-order-functions