Box.MapSet (box v0.15.1)

View Source

Extra functions to work with MapSets.

Summary

Functions

Removes the item if present, adds if missing

Functions

toggle(map_set, item)

@spec toggle(MapSet.t(), any()) :: MapSet.t()

Removes the item if present, adds if missing

Examples

iex> Box.MapSet.toggle(MapSet.new([1, 2]), 1) MapSet.new([2])

iex> Box.MapSet.toggle(MapSet.new([1, 2]), 3) MapSet.new([1, 2, 3])