How to use MapSet

Functions that work on sets.

MapSet is the "go to" set data structure in Elixir.

How to use MapSet?

iex(1)> map_set = MapSet.new()
#MapSet<[]
iex(2)> map_set |> MapSet.put("foo") |> MapSet.put("bar") |> MapSet.put("foo")
#MapSet<["bar", "foo"]>

A MapSet is represented internally using the %MapSet{} struct. This struct can be used whenever there's a need to pattern match on something being a MapSe

iex(1)> match?(%MapSet{}, MapSet.new())
true
iex(1)> MapSet.equal?(MapSet.new([1,2]), MapSet.new([2,1]))
true

More details https://hexdocs.pm/elixir/MapSet.html