Logo

Programming-Idioms

History of Idiom 189 > diff from v15 to v16

Edit summary for version 16 by cbley:
New Scala implementation by user [cbley]

Version 15

2019-10-01, 15:34:00

Version 16

2019-10-02, 09:22:28

Idiom #189 Filter and transform list

Produce a new list y containing the result of function T applied to all elements e of list x that match the predicate P.

Idiom #189 Filter and transform list

Produce a new list y containing the result of function T applied to all elements e of list x that match the predicate P.

Extra Keywords
map apply
Extra Keywords
map apply
Code
list.collect { case x if p(x) => T(x) }