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 =
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{},
iex(1)> MapSet.equal?([1,2]),[2,1]))

More details