MapSet.new

You're seeing just the function new, go back to MapSet module for more information.

Specs

new() :: t()

Returns a new set.

Examples

iex> MapSet.new()
#MapSet<[]>

Specs

new(Enum.t()) :: t()

Creates a set from an enumerable.

Examples

iex> MapSet.new([:b, :a, 3])
#MapSet<[3, :a, :b]>
iex> MapSet.new([3, 3, 3, 2, 2, 1])
#MapSet<[1, 2, 3]>
Link to this function

new(enumerable, transform)

View Source

Specs

new(Enum.t(), (term() -> val)) :: t(val) when val: value()

Creates a set from an enumerable via the transformation function.

Examples

iex> MapSet.new([1, 2, 1], fn x -> 2 * x end)
#MapSet<[2, 4]>