Logo

Programming-Idioms

History of Idiom 189 > diff from v28 to v29

Edit summary for version 29 by quorauk:
New Elixir implementation by user [quorauk]

Version 28

2020-03-18, 10:44:21

Version 29

2020-07-12, 00:31:21

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.

Variables
y,T,e,x,P
Extra Keywords
map apply satisfy
Extra Keywords
map apply satisfy
Code
y = x
|> Enum.filter(&P/1)
|> Enum.map(&P(&T/1)