Settings

Theme

Swift: The Tao of Mappage

ericasadun.com

17 points by xngzng 11 years ago · 1 comment

Reader

MCRed 11 years ago

Too bad this article didn't get picked up on HN. It's really good.

Map is a wonderful thing, and one of the neatest features of Elixir is the |> operator which means "take the output of the last function and put it in as the first parameter of the next" So you can write things like:

Enum.map(first_list, first_function) |> Enum.map(second_function) # This map runs over the output of the first.

I hope there's a way to do something like this in swift... cause it makes programming fun. It's basically Enum.map(Enum.Map(first_list, first_function), second_Function).

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection