[erlang-bugs] maps:map/2 incorrect transformation signature

Daniel Goertzen <>
Mon Oct 28 18:07:28 CET 2013


According to eep-43, the transformation function in maps:map/2 should
return a new value for each key and value provided.  However, the current
implementation expects the function to return a key/value tuple.

Eep-43 is consistent with dict:map/2, so I think the implementation should
be corrected (as opposed to the eep)


Failing example (expected result is #{abc => 124})

2> maps:map( fun(_K, V) -> V+1 end, #{abc => 123}).
** exception error: bad argument
     in function  maps:from_list/1
        called as maps:from_list("|")
     in call from maps:map/2 (maps.erl, line 195)


Cheers,
Dan.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20131028/1e024213/attachment.html>


More information about the erlang-bugs mailing list