Maps: Associative Key-Value Stores
Maps were made available from version R17 of Erlang.
Maps have the following properties:
-
The syntax of maps is similar to that of records, except the record name is omitted and the key-value separator is either
=>or:=. -
Maps are associative collections of key-value pairs.
-
The keys in a map can be any fully ground Erlang term (fully grounded means that there are no unbound variables in the term).
-
The elements in a map are ordered by the keys.
-
Updating a map where the keys are not changed is a space-efficient operation.
-
Looking up the value of a key in a map is an efficient operation.
-
Maps have a well-defined order.
We’ll look at maps in more detail in the following sections.
The Semantics of Maps
Map literals ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access