February 2018
Beginner
200 pages
4h 37m
English
The each, map, reduce, and filter list operations are useful. Almost all of the programming tasks you’ll do with lists can benefit from these functions. Thanks to Elixir’s core team, you don’t need to write these higher-order functions every time you start a new Elixir project, because they’re available in the Enum module. You wrote all these functions to understand how to create higher-order functions. From now on, you’ll use them directly from the Enum module. Now we’ll experiment with more useful higher-order functions from that module, starting with ones you’ve built. Open your IEx and try this:
| | iex> Enum.each(["dogs", "cats", "flowers"], &(IO.puts String.upcase(&1))) |
| | DOGS |
| | CATS |
| | FLOWERS |
| | iex> Enum.map([ ... |
Read now
Unlock full access