Skip to content

Instantly share code, notes, and snippets.

@Tombarr
Last active January 10, 2019 14:00
Show Gist options
  • Select an option

  • Save Tombarr/7c7174dbba3e68d63b3463925acba511 to your computer and use it in GitHub Desktop.

Select an option

Save Tombarr/7c7174dbba3e68d63b3463925acba511 to your computer and use it in GitHub Desktop.
Lambdas in Elixir
# 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