Last active
January 10, 2019 14:00
-
-
Save Tombarr/7c7174dbba3e68d63b3463925acba511 to your computer and use it in GitHub Desktop.
Lambdas in Elixir
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Lambdas with one parameter | |
| [1, 2, 3] |> Enum.map(&(&1 * &1)) # [1, 4, 9] | |
| # Lambdas with multiple parameters | |
| [1, 2, 3] |> Enum.reduce(&(&1 + &2)) # 6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment