X-Git-Url: https://git.xandkar.net/?a=blobdiff_plain;f=src%2Fhope_dictionary.erl;h=7930c1daaab115e84453ab6fb4e8e66f2b573425;hb=70cf8e86a06d8721fcc8b658bb2be1f7b401326f;hp=2e3a59d6d49aa69aeed522ae00ced57f1681d7ef;hpb=cd69f1f3699412fbb3fa8d304f5a377d83efc8ff;p=hope.git diff --git a/src/hope_dictionary.erl b/src/hope_dictionary.erl index 2e3a59d..7930c1d 100644 --- a/src/hope_dictionary.erl +++ b/src/hope_dictionary.erl @@ -21,6 +21,9 @@ -callback update(t(K, V), K, fun((hope_option:t(V)) -> V)) -> t(K, V). +-callback pop(t(K, V), K) -> + {hope_option:t(V), t(K, V)}. + -callback map(t(K, V), fun((K, V) -> V)) -> t(K, V). @@ -33,6 +36,7 @@ -callback iter(t(K, V), fun((K, V) -> ok)) -> ok. +%% TODO: Decide if validation is to be done. If yes - wrap in hope_result:t/1 -callback of_kv_list([{K, V}]) -> t(K, V).