Skip to content

Instantly share code, notes, and snippets.

@cheeyeo
Created October 13, 2013 13:35
Show Gist options
  • Save cheeyeo/6962447 to your computer and use it in GitHub Desktop.
Save cheeyeo/6962447 to your computer and use it in GitHub Desktop.
Some simple elixir anonymous functions
list_concat = fn a,b -> a ++ b end
list_concat.([1,2,3],[4,5,6])
sum = fn a,b,c -> a + b + c end
sum.(1,2,3)
swap = fn {a,b} -> [a,b] end
swap.({5,6}) # [5,6]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment