Toolbelt v0.3.1 Toolbelt.Keyword

Functions closely related to Keyword that didn’t make it or didn’t yet make it to the standard library.

Summary

Functions

Fetches a value on the given path in a deeply nested keyword list

Determines if the given value can be used as a keyword list element

Just like Enum.map, except that nested keyword lists within the given list will be tranversed and also transformed

Similar to Maplike.merge_deep, but only merges on nested maps

Creates a new keyword list from another list with only keys in it that have the given prefix

Similar to Kernel.put_in/3, but creates new keyword lists if nil is returned while traversing the path

Functions

delete(xA, xB)

See Keyword.delete/2.

delete(xA, xB, xC)

See Keyword.delete/3.

delete_first(xA, xB)

See Keyword.delete_first/2.

drop(xA, xB)

See Keyword.drop/2.

equal?(xA, xB)

See Keyword.equal?/2.

fetch(xA, xB)

See Keyword.fetch/2.

fetch!(xA, xB)

See Keyword.fetch!/2.

filter(keyword, fun)

See Enum.filter/2.

get(xA, xB)

See Keyword.get/2.

get(xA, xB, xC)

See Keyword.get/3.

get_and_update(xA, xB, xC)

See Keyword.get_and_update/3.

get_and_update!(xA, xB, xC)

See Keyword.get_and_update!/3.

get_deep(lst, list)

Fetches a value on the given path in a deeply nested keyword list.

get_lazy(xA, xB, xC)

See Keyword.get_lazy/3.

get_values(xA, xB)

See Keyword.get_values/2.

has_key?(xA, xB)

See Keyword.has_key?/2.

is_keyword_element(val)

Determines if the given value can be used as a keyword list element.

keys(xA)

See Keyword.keys/1.

keyword?(xA)

See Keyword.keyword?/1.

map(keyword, fun)

See Enum.map/2.

map_deep(m, callback)

Just like Enum.map, except that nested keyword lists within the given list will be tranversed and also transformed.

map_keys(m, fun)
map_keys_deep(lst, fun)
map_values(m, fun)
map_values_deep(lst, fun)
merge(xA, xB)

See Keyword.merge/2.

merge(xA, xB, xC)

See Keyword.merge/3.

merge_deep(a, b)

Similar to Maplike.merge_deep, but only merges on nested maps.

new()

See Keyword.new/0.

new(xA)

See Keyword.new/1.

new(xA, xB)

See Keyword.new/2.

pick_prefixed(lst, prefix)

Creates a new keyword list from another list with only keys in it that have the given prefix.

pop(xA, xB)

See Keyword.pop/2.

pop(xA, xB, xC)

See Keyword.pop/3.

pop_first(xA, xB)

See Keyword.pop_first/2.

pop_first(xA, xB, xC)

See Keyword.pop_first/3.

pop_lazy(xA, xB, xC)

See Keyword.pop_lazy/3.

put(xA, xB, xC)

See Keyword.put/3.

put_in_create(map, list, val)

Similar to Kernel.put_in/3, but creates new keyword lists if nil is returned while traversing the path.

put_new(xA, xB, xC)

See Keyword.put_new/3.

put_new_lazy(xA, xB, xC)

See Keyword.put_new_lazy/3.

reduce(keyword, acc, fun)

See Enum.reduce/3.

replace(xA, xB, xC)

See Keyword.replace/3.

replace!(xA, xB, xC)

See Keyword.replace!/3.

size(xA)

See Keyword.size/1.

split(xA, xB)

See Keyword.split/2.

take(xA, xB)

See Keyword.take/2.

to_list(xA)

See Keyword.to_list/1.

to_map(lst)
to_map_deep(lst)
update(xA, xB, xC, xD)

See Keyword.update/4.

update!(xA, xB, xC)

See Keyword.update!/3.

values(xA)

See Keyword.values/1.