From: Siraaj Khandkar Date: Tue, 12 Aug 2014 20:58:53 +0000 (-0400) Subject: Add specs to hope_kv_list helpers. X-Git-Tag: 1.0.0~18 X-Git-Url: https://git.xandkar.net/?a=commitdiff_plain;h=4837199955e534be82f8a876171581cf87b3f82a;p=hope.git Add specs to hope_kv_list helpers. --- diff --git a/src/hope_kv_list.erl b/src/hope_kv_list.erl index 468c8d8..3ca9d07 100644 --- a/src/hope_kv_list.erl +++ b/src/hope_kv_list.erl @@ -79,8 +79,15 @@ of_kv_list(List) -> %% Helpers %% ============================================================================ +-spec lift_map(F) -> + G + when F :: fun(( K, V1 ) -> V2) + , G :: fun(({K, V1}) -> V2) + . lift_map(F) -> fun (X) -> apply_map(F, X) end. +-spec apply_map(fun((K, V1) -> V2), {K, V1}) -> + V2. apply_map(F, {K, V}) -> F(K, V).