X-Git-Url: https://git.xandkar.net/?a=blobdiff_plain;f=src%2Fhope_gen_dictionary.erl;h=174ef67419c9638368e1ddf3fd05ced52966601e;hb=0ed4baebe135edc50d24d3613c6ee971f75d8c98;hp=0d45ecda04163e09bc0952617b7397c82eba13a5;hpb=b69220d7a75faba9743d5b89b6fa40443cd39eec;p=hope.git diff --git a/src/hope_gen_dictionary.erl b/src/hope_gen_dictionary.erl index 0d45ecd..174ef67 100644 --- a/src/hope_gen_dictionary.erl +++ b/src/hope_gen_dictionary.erl @@ -15,6 +15,12 @@ -callback get(t(K, V), K) -> hope_option:t(V). +-callback get(t(K, V), K, V) -> + V. + +-callback get(t(K, V), K, V, fun((V) -> boolean())) -> + V. + -callback set(t(K, V), K, V) -> t(K, V). @@ -33,7 +39,7 @@ -callback fold(t(K, V), fun((K, V, Acc) -> Acc), Acc) -> Acc. --callback iter(t(K, V), fun((K, V) -> ok)) -> +-callback iter(t(K, V), fun((K, V) -> any())) -> ok. %% TODO: Decide if validation is to be done. If yes - wrap in hope_result:t/1 @@ -42,3 +48,6 @@ -callback to_kv_list(t(K, V)) -> [{K, V}]. + +-callback has_key(t(K, _), K) -> + boolean().