PassiveSupport.MapSet (passive_support v0.8.3)

Functions for working with MapSets.

Link to this section Summary

Functions

Adds element to set if it isn't already a member, and deletes it if it is.

Link to this section Functions

Link to this function

toggle(set, element)

Specs

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

Adds element to set if it isn't already a member, and deletes it if it is.

Examples

iex> MapSet.new(["ketchup", "pickles"])
...>   |> toggle("mustard")
...>   |> toggle("pickles")
...>   |> toggle("barbecue sauce")
#MapSet<["barbecue sauce", "ketchup", "mustard"]>