4 ms·
It seems he may have some good points, but he definitely tried pretty hard to make some of the examples ugly. The way currying is generally done in Scala is mu
by stephenjudkins 17y ago
It seems he may have some good points, but he definitely tried pretty hard to make some of the examples ugly. The way currying is generally done in Scala is much cleaner-looking than this, as the first several google results for "scala currying" show. Also, he seems to throw in some extra unnecessary stuff (sealed?) in the case classes example.
I appreciate informed criticisms like this, but he is definitely representing Scala in as poor a light as possible.
- mrkurt 17y agoHe speaks to the currying syntax directly in the comments. The important distinction is that the "nice" Scala syntax for currying requires that you allow for it when you write your functions. That's not really broadly useful, though it can pretty up some applications.
- KrisJordan 17y agoFrom reading Odersky's book Scala's notion of currying functions i.e. f(x:Int)(y:Int) is differentiated from partially applied functions. Here is his currying example using a partially applied x(): def x(a:Int, b:Int) = a + b val y = x(1, _:Int) // y is a partially applied function y(2) ========== Much better looking than his snippet: def x(a:Int, b:Int) = a + b def y = Function.curried(x _)(1) y(2)