Swiss.MapSet (swiss v3.12.0) View Source

Helper functions for MapSets.

Link to this section Summary

Functions

Toggles a value within a MapSet (adds if missing, removes if present).

Link to this section Functions

Specs

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

Toggles a value within a MapSet (adds if missing, removes if present).

Examples

iex> Swiss.MapSet.toggle MapSet.new(), 42
#MapSet<[42]>

iex> Swiss.MapSet.toggle MapSet.new([42]), 42
#MapSet<[]>

iex> Swiss.MapSet.toggle MapSet.new([42]), 55
#MapSet<[42, 55]>