Dict — Elixir v1.16.3

Search documentation of Elixir

# View Source Dict (Elixir v1.16.3)

This module is deprecated. Use Map or Keyword modules instead.

Generic API for dictionaries.

If you need a general dictionary, use the `Map` module. If you need to manipulate keyword lists, use `Keyword`.

To convert maps into keywords and vice-versa, use the `new` function in the respective modules.

# Summary

## Types

key()
t()
value()

## Functions

delete(dict, key) deprecated
drop(dict, keys) deprecated
empty(dict) deprecated
equal?(dict1, dict2) deprecated
fetch(dict, key) deprecated
fetch!(dict, key) deprecated
get(dict, key, default \\ nil) deprecated
get_and_update(dict, key, fun) deprecated
get_lazy(dict, key, fun) deprecated
has_key?(dict, key) deprecated
keys(dict) deprecated
merge(dict1, dict2) deprecated
merge(dict1, dict2, fun) deprecated
pop(dict, key, default \\ nil) deprecated
pop_lazy(dict, key, fun) deprecated
put(dict, key, val) deprecated
put_new(dict, key, val) deprecated
put_new_lazy(dict, key, fun) deprecated
size(dict) deprecated
split(dict, keys) deprecated
take(dict, keys) deprecated
to_list(dict) deprecated
update(dict, key, default, fun) deprecated
update!(dict, key, fun) deprecated
values(dict) deprecated

# Types

Link to this type

# key()

View Source

    @type key() :: any()

Link to this type

# t()

View Source

    @type t() :: list() | map()

Link to this type

# value()

View Source

    @type value() :: any()

# Functions

Link to this function

# delete(dict, key)

View Source
This function is deprecated. Use the Map module for working with maps or the Keyword module for working with keyword lists.

    @spec delete(t(), key()) :: t()

Link to this function

# drop(dict, keys)

View Source
This function is deprecated. Use the Map module for working with maps or the Keyword module for working with keyword lists.

    @spec drop(t(), [key()]) :: t()

Link to this function

# empty(dict)

View Source
This function is deprecated. Use the Map module for working with maps or the Keyword module for working with keyword lists.

    @spec empty(t()) :: t()

Link to this function

# equal?(dict1, dict2)

View Source
This function is deprecated. Use the Map module for working with maps or the Keyword module for working with keyword lists.

    @spec equal?(t(), t()) :: boolean()

Link to this function

# fetch(dict, key)

View Source
This function is deprecated. Use the Map module for working with maps or the Keyword module for working with keyword lists.

    @spec fetch(t(), key()) :: value()

Link to this function

# fetch!(dict, key)

View Source
This function is deprecated. Use the Map module for working with maps or the Keyword module for working with keyword lists.

    @spec fetch!(t(), key()) :: value()

Link to this function

# get(dict, key, default \\ nil)

View Source
This function is deprecated. Use the Map module for working with maps or the Keyword module for working with keyword lists.

    @spec get(t(), key(), value()) :: value()

Link to this function

# get_and_update(dict, key, fun)

View Source
This function is deprecated. Use the Map module for working with maps or the Keyword module for working with keyword lists.

    @spec get_and_update(t(), key(), (value() -> {value(), value()})) :: {value(), t()}

Link to this function

# get_lazy(dict, key, fun)

View Source
This function is deprecated. Use the Map module for working with maps or the Keyword module for working with keyword lists.

    @spec get_lazy(t(), key(), (-> value())) :: value()

Link to this function

# has_key?(dict, key)

View Source
This function is deprecated. Use the Map module for working with maps or the Keyword module for working with keyword lists.

    @spec has_key?(t(), key()) :: boolean()

Link to this function

# keys(dict)

View Source
This function is deprecated. Use the Map module for working with maps or the Keyword module for working with keyword lists.

    @spec keys(t()) :: [key()]

Link to this function

# merge(dict1, dict2)

View Source
This function is deprecated. Use the Map module for working with maps or the Keyword module for working with keyword lists.

    @spec merge(t(), t()) :: t()

Link to this function

# merge(dict1, dict2, fun)

View Source
This function is deprecated. Use the Map module for working with maps or the Keyword module for working with keyword lists.

    @spec merge(t(), t(), (key(), value(), value() -> value())) :: t()

Link to this function

# pop(dict, key, default \\ nil)

View Source
This function is deprecated. Use the Map module for working with maps or the Keyword module for working with keyword lists.

    @spec pop(t(), key(), value()) :: {value(), t()}

Link to this function

# pop_lazy(dict, key, fun)

View Source
This function is deprecated. Use the Map module for working with maps or the Keyword module for working with keyword lists.

    @spec pop_lazy(t(), key(), (-> value())) :: {value(), t()}

Link to this function

# put(dict, key, val)

View Source
This function is deprecated. Use the Map module for working with maps or the Keyword module for working with keyword lists.

    @spec put(t(), key(), value()) :: t()

Link to this function

# put_new(dict, key, val)

View Source
This function is deprecated. Use the Map module for working with maps or the Keyword module for working with keyword lists.

    @spec put_new(t(), key(), value()) :: t()

Link to this function

# put_new_lazy(dict, key, fun)

View Source
This function is deprecated. Use the Map module for working with maps or the Keyword module for working with keyword lists.

    @spec put_new_lazy(t(), key(), (-> value())) :: t()

Link to this function

# size(dict)

View Source
This function is deprecated. Use the Map module for working with maps or the Keyword module for working with keyword lists.

    @spec size(t()) :: non_neg_integer()

Link to this function

# split(dict, keys)

View Source
This function is deprecated. Use the Map module for working with maps or the Keyword module for working with keyword lists.

    @spec split(t(), [key()]) :: {t(), t()}

Link to this function

# take(dict, keys)

View Source
This function is deprecated. Use the Map module for working with maps or the Keyword module for working with keyword lists.

    @spec take(t(), [key()]) :: t()

Link to this function

# to_list(dict)

View Source
This function is deprecated. Use the Map module for working with maps or the Keyword module for working with keyword lists.

    @spec to_list(t()) :: list()

Link to this function

# update(dict, key, default, fun)

View Source
This function is deprecated. Use the Map module for working with maps or the Keyword module for working with keyword lists.

    @spec update(t(), key(), value(), (value() -> value())) :: t()

Link to this function

# update!(dict, key, fun)

View Source
This function is deprecated. Use the Map module for working with maps or the Keyword module for working with keyword lists.

    @spec update!(t(), key(), (value() -> value())) :: t()

Link to this function

# values(dict)

View Source
This function is deprecated. Use the Map module for working with maps or the Keyword module for working with keyword lists.

    @spec values(t()) :: [value()]