Skip to content

Instantly share code, notes, and snippets.

@eibrahim
Created February 2, 2016 14:09
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 eibrahim/0bb929360bdb4732b5e0 to your computer and use it in GitHub Desktop.
Save eibrahim/0bb929360bdb4732b5e0 to your computer and use it in GitHub Desktop.
List subtraction and concatenation
def list_concat a,b do a ++ b end
def list_sub a,b do a -- b end
#you can test this in iex
list_concat2 = &(&1 ++ &2)
list_concat2.([1,2],[3,4])
list_sub2 = &(&1 -- &2)
list_sub2.([1,2,3,4], [3,9,8,2])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment