W3cubDocs

/Elixir 1.5

Dict

WARNING: this module is deprecated.

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)
drop(dict, keys)
empty(dict)
equal?(dict1, dict2)
fetch(dict, key)
fetch!(dict, key)
get(dict, key, default \\ nil)
get_and_update(dict, key, fun)
get_lazy(dict, key, fun)
has_key?(dict, key)
keys(dict)
merge(dict1, dict2)
merge(dict1, dict2, fun)
pop(dict, key, default \\ nil)
pop_lazy(dict, key, fun)
put(dict, key, val)
put_new(dict, key, val)
put_new_lazy(dict, key, fun)
size(dict)
split(dict, keys)
take(dict, keys)
to_list(dict)
update(dict, key, initial, fun)
update!(dict, key, fun)
values(dict)

Types

key()

key() :: any

t()

t() :: list | map

value()

value() :: any

Functions

delete(dict, key)

delete(t, key) :: t

drop(dict, keys)

drop(t, [key]) :: t

empty(dict)

empty(t) :: t

equal?(dict1, dict2)

equal?(t, t) :: boolean

fetch(dict, key)

fetch(t, key) :: value

fetch!(dict, key)

fetch!(t, key) :: value | no_return

get(dict, key, default \\ nil)

get(t, key, value) :: value

get_and_update(dict, key, fun)

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

get_lazy(dict, key, fun)

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

has_key?(dict, key)

has_key?(t, key) :: boolean

keys(dict)

keys(t) :: [key]

merge(dict1, dict2)

merge(t, t) :: t

merge(dict1, dict2, fun)

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

pop(dict, key, default \\ nil)

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

pop_lazy(dict, key, fun)

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

put(dict, key, val)

put(t, key, value) :: t

put_new(dict, key, val)

put_new(t, key, value) :: t

put_new_lazy(dict, key, fun)

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

size(dict)

size(t) :: non_neg_integer

split(dict, keys)

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

take(dict, keys)

take(t, [key]) :: t

to_list(dict)

to_list(t) :: list

update(dict, key, initial, fun)

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

update!(dict, key, fun)

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

values(dict)

values(t) :: [value]

© 2012–2017 Plataformatec
Licensed under the Apache License, Version 2.0.
https://hexdocs.pm/elixir/1.5.0/Dict.html