Module s2_maps

Nested dictionaries.

Description

Nested dictionaries.

Copyright 2011-2013 Klarna AB

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Data Types

maybe()

maybe(A, B) = {ok, A} | {error, B}

t()

t() = dict:dict()

Function Index

delete/2Prune everything below Ks from Map.
get/2Look up the value associated with the leaf reachable via Ks in Map.
get/3
new/0Return a fresh map.
set/3Set the leaf reachable via Ks in Map to V.
to_list/1Return the list-representation of Map.
update/4Update the leaf reachable via Ks in Map to the result of applying F to its current value or V if it doesn't have one.

Function Details

delete/2

delete(Map::t(), Ks::[term()]) -> t()

Prune everything below Ks from Map.

get/2

get(Map::t(), Ks::[term()]) -> maybe(term(), notfound)

Look up the value associated with the leaf reachable via Ks in Map.

get/3

get(Map, Ks, Default) -> any()

new/0

new() -> t()

Return a fresh map.

set/3

set(Map::t(), Ks::[term()], V::term()) -> t()

Set the leaf reachable via Ks in Map to V.

to_list/1

to_list(Map::t()) -> [term()]

Return the list-representation of Map.

update/4

update(Map::t(), Ks::[term()], F::function(), V::term()) -> t()

Update the leaf reachable via Ks in Map to the result of applying F to its current value or V if it doesn't have one.


Generated by EDoc, Mar 14 2025, 16:51:43.