From 7cae8734155671908264dc5ad057879125125ffe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Muska=C5=82a?= Date: Thu, 19 Jul 2018 19:37:07 +0200 Subject: Refine types of functions in maps module This only touches functions that are not further manually enhanced in erl_bif_types. The hope is that this will allow dialyzer to discover more issues in code using maps. --- lib/stdlib/doc/src/maps.xml | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) (limited to 'lib/stdlib/doc') diff --git a/lib/stdlib/doc/src/maps.xml b/lib/stdlib/doc/src/maps.xml index a225dea3b5..4c5199ca2b 100644 --- a/lib/stdlib/doc/src/maps.xml +++ b/lib/stdlib/doc/src/maps.xml @@ -35,9 +35,10 @@ - + -

An iterator representing the key value associations in a map.

+

An iterator representing the associations in a map with keys of type + Key and values of type Value.

Created using maps:iterator/1.

Consumed by maps:next/1, maps:filter/2, @@ -45,6 +46,10 @@ maps:map/2.

+ + + +
@@ -90,13 +95,13 @@ -

Calls F(K, V, AccIn) for every K to value - V association in MapOrIter in - any order. Function fun F/3 must return a new - accumulator, which is passed to the next successive call. - This function returns the final value of the accumulator. The initial - accumulator value Init is returned if the map is - empty.

+

Calls F(Key, Value, AccIn) for every Key + to value Value association in + MapOrIter in any order. Function fun F/3 + must return a new accumulator, which is passed to the next successive + call. This function returns the final value of the accumulator. + The initial accumulator value Init is returned + if the map is empty.

The call fails with a {badmap,Map} exception if MapOrIter is not a map or valid iterator, or with badarg if Fun is not a @@ -234,11 +239,12 @@ none

Produces a new map Map by calling function - fun F(K, V1) for every K to value - V1 association in MapOrIter in - any order. Function fun F/2 must return value - V2 to be associated with key K - for the new map Map.

+ fun F(Key, Value1) for every Key to value + Value1 association in + MapOrIter in any order. Function fun Fun/2 + must return value Value2 to be associated with + key Key for the new map + Map.

The call fails with a {badmap,Map} exception if MapOrIter is not a map or valid iterator, or with badarg if Fun is not a -- cgit v1.2.3