BiMap.new

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

Specs

new() :: t()

Creates a new bimap.

Examples

iex> BiMap.new
#BiMap<[]>

Specs

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

Creates a bimap from enumerable of key-value pairs.

Duplicated pairs are removed; the latest one prevails.

Examples

iex> BiMap.new([a: "foo", b: "bar"])
#BiMap<[a: "foo", b: "bar"]>
Link to this function

new(enumerable, transform)

View Source

Specs

new(Enum.t(), (term() -> {k(), v()})) :: t()

Creates a bimap from enumerable via transform function returning key-value pairs.

Examples

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