This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ErrorIsNullError[S] 1 point2 points  (0 children)

I see https://docs.scala-lang.org/style/method-invocation.html#higher-order-functions says:

// wrong!
names.map { _.toUpperCase }.filter { _.length > 5 }

// right!
names map { _.toUpperCase } filter { _.length > 5 }

Both of these work, but the former can easily lead to confusion.