Declaring functions two ways. What is the distinction?

Posted by Synesso on Stack Overflow See other posts from Stack Overflow or by Synesso
Published on 2010-04-27T10:48:42Z Indexed on 2010/04/27 11:13 UTC
Read the original article Hit count: 155

Filed under:

Are these two function declarations effectively different?

If not, why do they have different toString values?

scala> def f: (Int) => Int = x=> x*x
f: (Int) => Int

scala> def f(x: Int) = x*x
f: (Int)Int

© Stack Overflow or respective owner

Related posts about scala