2016 Update

This commit is contained in:
Tina Müller 2016-12-05 22:15:40 +01:00
parent 948b86eafa
commit dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions

View file

@ -1,8 +1,8 @@
iex(1)> a = Enum.into(~w(John Bob Mary Serena), HashSet.new)
#HashSet<["Mary", "Serena", "John", "Bob"]>
iex(2)> b = Enum.into(~w(Jim Mary John Bob), HashSet.new)
#HashSet<["Mary", "Jim", "John", "Bob"]>
iex(3)> sym_dif = fn(a,b) -> Set.difference(Set.union(a,b), Set.intersection(a,b)) end
#Function<12.90072148/2 in :erl_eval.expr/5>
iex(1)> a = ~w[John Bob Mary Serena] |> MapSet.new
#MapSet<["Bob", "John", "Mary", "Serena"]>
iex(2)> b = ~w[Jim Mary John Bob] |> MapSet.new
#MapSet<["Bob", "Jim", "John", "Mary"]>
iex(3)> sym_dif = fn(a,b) -> MapSet.difference(MapSet.union(a,b), MapSet.intersection(a,b)) end
#Function<12.54118792/2 in :erl_eval.expr/5>
iex(4)> sym_dif.(a,b)
#HashSet<["Serena", "Jim"]>
#MapSet<["Jim", "Serena"]>