2016 Update
This commit is contained in:
parent
948b86eafa
commit
dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions
|
|
@ -1,26 +1,28 @@
|
|||
iex(101)> s = HashSet.new
|
||||
#HashSet<[]>
|
||||
iex(102)> sa = Set.put(s, :a)
|
||||
#HashSet<[:a]>
|
||||
iex(103)> sab = Set.put(sa, :b)
|
||||
#HashSet<[:b, :a]>
|
||||
iex(104)> sbc = Enum.into([:b,:c], HashSet.new)
|
||||
#HashSet<[:c, :b]>
|
||||
iex(105)> Set.member?(sa, :a)
|
||||
iex(1)> s = MapSet.new
|
||||
#MapSet<[]>
|
||||
iex(2)> sa = MapSet.put(s, :a)
|
||||
#MapSet<[:a]>
|
||||
iex(3)> sab = MapSet.put(sa, :b)
|
||||
#MapSet<[:a, :b]>
|
||||
iex(4)> sbc = Enum.into([:b, :c], MapSet.new)
|
||||
#MapSet<[:b, :c]>
|
||||
iex(5)> MapSet.member?(sab, :a)
|
||||
true
|
||||
iex(106)> Set.member?(sa, :b)
|
||||
iex(6)> MapSet.member?(sab, :c)
|
||||
false
|
||||
iex(107)> Set.union(sab, sbc)
|
||||
#HashSet<[:c, :b, :a]>
|
||||
iex(108)> Set.intersection(sab, sbc)
|
||||
#HashSet<[:b]>
|
||||
iex(109)> Set.difference(sab, sbc)
|
||||
#HashSet<[:a]>
|
||||
iex(110)> Set.disjoint?(sab, sbc)
|
||||
false
|
||||
iex(111)> Set.subset?(sa, sab)
|
||||
iex(7)> :a in sab
|
||||
true
|
||||
iex(112)> Set.subset?(sab, sa)
|
||||
iex(8)> MapSet.union(sab, sbc)
|
||||
#MapSet<[:a, :b, :c]>
|
||||
iex(9)> MapSet.intersection(sab, sbc)
|
||||
#MapSet<[:b]>
|
||||
iex(10)> MapSet.difference(sab, sbc)
|
||||
#MapSet<[:a]>
|
||||
iex(11)> MapSet.disjoint?(sab, sbc)
|
||||
false
|
||||
iex(113)> sa == sab
|
||||
iex(12)> MapSet.subset?(sa, sab)
|
||||
true
|
||||
iex(13)> MapSet.subset?(sab, sa)
|
||||
false
|
||||
iex(14)> sa == sab
|
||||
false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue