Skip to content

Instantly share code, notes, and snippets.

@opensussex
Created April 10, 2018 19:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save opensussex/0f3ddc4c2b69fb4c90f9710d8d96085a to your computer and use it in GitHub Desktop.
Save opensussex/0f3ddc4c2b69fb4c90f9710d8d96085a to your computer and use it in GitHub Desktop.
example of some elixir anonymous function
apply_tax = fn price -> tax = (price * 0.12); total = price + tax;IO.puts "Price: #{total} - Tax: #{tax}" end;
Enum.each [12.5, 30.99, 250.49, 18.80], apply_tax
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment