Your Turn
Programming Elixir ≥ 1.6 — by Dave Thomas (63 / 230)
👈 Reducing a List to a Single Value | TOC | More Complex List Patterns 👉
- Exercise: ListsAndRecursion-1
- Write a mapsum function that takes a list and a function. It applies the function to each element of the list and then sums the result, so
- iex> MyList.mapsum [1, 2, 3], &(&1 * &1) 14
- Exercise: ListsAndRecursion-2
- Write a max(list) that returns the element with the maximum value in the list…