@@ -244,18 +244,19 @@ differ from a function value such as:
244
244
245
245
val square: Int => Int = x => x * x
246
246
247
- For Scala 2, there is a [ complete answer on Stack Overflow] ( https://stackoverflow.com/a/2530007/4111404 )
247
+ For ** Scala 2** , there is a [ complete answer on Stack Overflow] ( https://stackoverflow.com/a/2530007/4111404 )
248
248
and a [ summary with practical differences] ( https://tpolecat.github.io/2014/06/09/methods-functions.html ) .
249
249
250
- Note that in ** Scala 3** the differences are fewer;
251
- for example, they will be able to
252
- [ accept implicit parameters] ({{ site.scala3ref }}/contextual/context-functions.html)
253
- as well as [ type parameters] ({{ site.scala3ref }}/new-types/polymorphic-function-types.html).
250
+ In ** Scala 3** , the differences are fewer.
251
+ [ Context functions] ({{ site.scala3ref }}/contextual/context-functions.html)
252
+ accept given parameters and
253
+ [ polymorphic functions] ({{ site.scala3ref }}/new-types/polymorphic-function-types.html)
254
+ have type parameters.
254
255
255
- Nevertheless, it is still recommended to use methods most of the time,
256
- unless you absolutely need a function. And, thanks to
257
- [ eta-expansion] ( https://stackoverflow.com/questions/39445018/what-is-the-eta-expansion-in-scala )
258
- you rarely would need to define a function rather than a method .
256
+ Most code uses methods most of the time,
257
+ unless a function value is actually needed. With
258
+ [ eta-expansion] ( https://stackoverflow.com/questions/39445018/what-is-the-eta-expansion-in-scala ) ,
259
+ a method can be converted as a function when needed .
259
260
260
261
### What's the difference between types and classes?
261
262
0 commit comments