MapSet
import IEx.Helpers
Creating
h MapSet
empty = MapSet.new()
eight = MapSet.new(1..8)
MapSet.member?(eight, 9) # false
MapSet.member?(eight, 8)
i eight
%MapSet{} = eight # match operation here
%Date{} = eight
Map.keys(eight)
Map.values(eight)
Adding Values
MapSet.put(empty, :one) |> MapSet.to_list()
Set Operations
one_four = MapSet.new(1..4)
five_eight = MapSet.new(5..8)
two_six = MapSet.new(2..6)
MapSet.disjoint?(one_four, five_eight)
MapSet.intersection(one_four, five_eight)
MapSet.intersection(one_four, two_six)
%{} |> Map.put(:one, []) |> Map.put(:one, [])
MapSet.new() |> MapSet.put(:one) |> MapSet.put(:one) |> Map.values()