Ignore outputs of side-effecting, element-handler functions.
[hope.git] / src / hope_kv_list.erl
index cb1c4a4..44a78d4 100644 (file)
@@ -25,6 +25,7 @@
     , fold/3
     , of_kv_list/1
     , to_kv_list/1
+    , has_key/2
     , find_unique_presence_violations/2  % No optional keys
     , find_unique_presence_violations/3  % Specify optional keys
     , validate_unique_presence/2  % No optional keys
@@ -104,7 +105,7 @@ pop(T1, K) ->
     ;   false               -> {none     , T1}
     end.
 
--spec iter(t(K, V), fun((K, V) -> ok)) ->
+-spec iter(t(K, V), fun((K, V) -> any())) ->
     ok.
 iter(T, F1) ->
     F2 = lift_map(F1),
@@ -206,6 +207,10 @@ presence_violations_to_list(#hope_kv_list_presence_violations
         end,
     ErrorDups ++ ErrorMissing ++ ErrorUnsupported.
 
+-spec has_key(t(K, _), K) ->
+    boolean().
+has_key(T, K1) ->
+    lists:any(fun ({K2, _}) -> K1 =:= K2 end, T).
 
 %% ============================================================================
 %% Helpers
This page took 0.023465 seconds and 4 git commands to generate.