[erlang-questions] Updating a map

Oliver Korpilla <>
Wed Jan 30 13:48:28 CET 2019


PS - maps:from_list/1 might be also what you are looking for. 

Gesendet: Mittwoch, 30. Januar 2019 um 13:47 Uhr
Von: "Oliver Korpilla" <>
An: "Donald Steven" <>
Cc: "Erlang Questions" <>
Betreff: Re: [erlang-questions] Updating a map
Hello, Donald.

You could use lists:foldr/3 to insert a list of key values into a map.

You would use the map itself as a the accumulator.

Best regards,
Oliver 

Gesendet: Mittwoch, 30. Januar 2019 um 13:27 Uhr
Von: "Donald Steven" <>
An: "Erlang Questions" <>
Betreff: [erlang-questions] Updating a map
The documentation for maps:update states:  update(Key, Value, Map1) ->
Map2, but since update has an arity of 3, this doesn't work: 
update(Key1, Value1, Key2, Value2, Map1) -> Map2.  Is there an
other-than one-by-one-sequential-update to update more than one
key-value in one shot?

Thanks.


Don


_______________________________________________
erlang-questions mailing list

http://erlang.org/mailman/listinfo/erlang-questions
_______________________________________________
erlang-questions mailing list

http://erlang.org/mailman/listinfo/erlang-questions[http://erlang.org/mailman/listinfo/erlang-questions]


More information about the erlang-questions mailing list