I have several questions related curried function. Here I ask them one-by-one
1) http://twitter.github.com/scala_school/basics.html gives an example of curried function -- I thought it's a function definition, but actually it's not. The REPL does not recognize this as a valid statement at all.
multiplyThenFilter { m: Int => m * 2 } { n: Int => n < 5}
2) Why can't we define a function from partially parameterized method? i.e., what's wrong with the following definition?
scala> def multiply(m: Int, n: Int): Int = m * n
multiply: (m: Int, n: Int)Int
scala> val timesTwo = multiply(2,_)
<console>:11: error: missing parameter type for expanded function ((x$1) => multiply(2, x$1))
val timesTwo = multiply(2,_)
^
3) Why can't we make a partially parameterized function curried? i.e., what's wrong with the following definition?
scala> (multiply(_,_)).curried
res13: Int => (Int => Int) = <function1> // THIS IS OK
scala> (multiply(20,_)).curried
<console>:12: error: missing parameter type for expanded function ((x$1) => multiply(20, x$1))
(multiply(20,_)).curried
^