# \#maps

**URL:** https://erlangforums.com/tag/maps/209.md

[Latest](https://erlangforums.com/latest.md) · [Categories](https://erlangforums.com/categories.md) · [Tags](https://erlangforums.com/tags.md)

---

## [Proposal: an opt-in emulator flag that makes map order independent of atom creation order](https://erlangforums.com/t/proposal-an-opt-in-emulator-flag-that-makes-map-order-independent-of-atom-creation-order/6033)

<div class="topic-metadata">

**Author:** [@anagrius](https://erlangforums.com/u/anagrius)\
**Replies:** 16\
**Last updated:** [October 29, 2026, 6:10pm UTC](https://erlangforums.com/t/proposal-an-opt-in-emulator-flag-that-makes-map-order-independent-of-atom-creation-order/6033 "2026-10-29T18:10:25Z")

</div>

I’ve been working on making our Elixir application build reproducibly under Bazel. After enabling deterministic, fixing the build path and normalising timestamps, we still had a bunch of BEAM files that differed between …

---

## [Map iteration order](https://erlangforums.com/t/map-iteration-order/5890)

<div class="topic-metadata">

**Author:** [@Maria-12648430](https://erlangforums.com/u/Maria-12648430)\
**Replies:** 1\
**Last updated:** [August 27, 2026, 11:53am UTC](https://erlangforums.com/t/map-iteration-order/5890 "2026-08-27T11:53:38Z")

</div>

The iteration order of an iterator created with maps:iterator(M, undefined) is undefined (yeah, duh). That is fine. I wonder however if that iteration order is guaranteed to be stable, that is, that repeated iterations r…

---

## [Maps:merge/1 idea](https://erlangforums.com/t/maps-merge-1-idea/5445)

<div class="topic-metadata">

**Author:** [@NelsonVides](https://erlangforums.com/u/NelsonVides)\
**Replies:** 0\
**Last updated:** [February 20, 2026, 7:02am UTC](https://erlangforums.com/t/maps-merge-1-idea/5445 "2026-02-20T07:02:16Z")

</div>

I’m curious how useful or sensible this might be: too often, I see code doing maps:merge(A, maps:merge(B, maps:merge(C, D))) (one example here: otp/lib/kernel/src/logger.erl at b2544ef4ce05c07fe793c570027caa51410dd66b · …

---

## [Clarification on using records vs maps for state in modern Erlang](https://erlangforums.com/t/clarification-on-using-records-vs-maps-for-state-in-modern-erlang/5192)

<div class="topic-metadata">

**Author:** [@dandan](https://erlangforums.com/u/dandan)\
**Replies:** 18\
**Last updated:** [November 4, 2025, 8:47am UTC](https://erlangforums.com/t/clarification-on-using-records-vs-maps-for-state-in-modern-erlang/5192 "2025-11-04T08:47:21Z")

</div>

Hi, I’ve read Joe Armstrong’s opinion that “records are dead, long live maps,” and I understand the benefits of maps in terms of flexibility and introspection. (https://joearms.github.io/#2014-02-01%20Big%20changes%20to…

---

## [Map comprehension behavior](https://erlangforums.com/t/map-comprehension-behavior/4922)

<div class="topic-metadata">

**Author:** [@uwiger](https://erlangforums.com/u/uwiger)\
**Replies:** 2\
**Last updated:** [July 23, 2025, 7:19pm UTC](https://erlangforums.com/t/map-comprehension-behavior/4922 "2025-07-23T19:19:44Z")

</div>

Erlang/OTP 27 \[erts-15.2.1\] \[source\] \[64-bit\] \[smp:12:12\] \[ds:12:12:10\] \[async-threads:1\] \[jit\] Eshell V15.2.1 (press Ctrl+G to abort, type help(). for help) 1\> #{ K =\> V || K \<- \[1,2,3\], V \<- \[a,b,c\]}. #{1 =\> a,2 =\> a,…

---

## [EEP 79: Deep Map Access](https://erlangforums.com/t/eep-79-deep-map-access/4521)

<div class="topic-metadata">

**Author:** [@eproxus](https://erlangforums.com/u/eproxus)\
**Replies:** 5\
**Last updated:** [February 22, 2025, 10:58am UTC](https://erlangforums.com/t/eep-79-deep-map-access/4521 "2025-02-22T10:58:25Z")

</div>

I’m proposing a new EEP Deep Map Access. Abstract Maps in Erlang are frequently used to represent nested structures, such as JSON data or configuration settings. This EEP proposes new library functions in the maps m…

---

## [Should adjacent map literals be a valid map update syntax?](https://erlangforums.com/t/should-adjacent-map-literals-be-a-valid-map-update-syntax/996)

<div class="topic-metadata">

**Author:** [@unix1](https://erlangforums.com/u/unix1)\
**Replies:** 7\
**Last updated:** [January 28, 2025, 7:51pm UTC](https://erlangforums.com/t/should-adjacent-map-literals-be-a-valid-map-update-syntax/996 "2025-01-28T19:51:46Z")

</div>

This has tripped me up a couple of times I missed a comma in a long list of maps 1\> #{a =\> b}#{c =\> d}. #{a =\> b,c =\> d} I would have expected this to be a syntax error, but it compiles and then troubleshooting takes a…

---

## [Nm - a tool to work with deeply nested data structures](https://erlangforums.com/t/nm-a-tool-to-work-with-deeply-nested-data-structures/4136)

<div class="topic-metadata">

**Author:** [@cevado](https://erlangforums.com/u/cevado)\
**Replies:** 3\
**Last updated:** [October 31, 2024, 7:18pm UTC](https://erlangforums.com/t/nm-a-tool-to-work-with-deeply-nested-data-structures/4136 "2024-10-31T19:18:33Z")

</div>

I’ve just publish something I’ve been experimenting with: Hex nm nm is a library to help manipulate and transform deeply nested data structures in a simple way. Since the discussion about local accumulators I’ve joi…

---

## [Unique keys in map - pattern matching](https://erlangforums.com/t/unique-keys-in-map-pattern-matching/3382)

<div class="topic-metadata">

**Author:** [@pawlowiczf](https://erlangforums.com/u/pawlowiczf)\
**Replies:** 4\
**Last updated:** [March 18, 2024, 7:56pm UTC](https://erlangforums.com/t/unique-keys-in-map-pattern-matching/3382 "2024-03-18T19:56:41Z")

</div>

Suppose, we have a map, whose keys are records: #{person, name, id} and values are ages. We know that there is no person with the same id. Is itpossible to write pattern matching shown below?: Age = maps:get( #person{ i…

---

## [Why Map comprehensions can't run without erlang/otp 25](https://erlangforums.com/t/why-map-comprehensions-cant-run-without-erlang-otp-25/3168)

<div class="topic-metadata">

**Author:** [@leeyis](https://erlangforums.com/u/leeyis)\
**Replies:** 7\
**Last updated:** [January 18, 2024, 3:56pm UTC](https://erlangforums.com/t/why-map-comprehensions-cant-run-without-erlang-otp-25/3168 "2024-01-18T15:56:45Z")

</div>

/Users/leeyi/project/imboy.pub/imboy \> erl Erlang/OTP 25 \[erts-13.2.2.4\] \[source\] \[64-bit\] \[smp:8:8\] \[ds:8:8:10\] \[async-threads:1\] \[jit:ns\] \[dtrace\] Eshell V13.2.2.4 (abort with ^G) 1\> Weather = #{toronto =\> rain, mo…

---

## [Maps - decade old example](https://erlangforums.com/t/maps-decade-old-example/2982)

<div class="topic-metadata">

**Author:** [@reymono](https://erlangforums.com/u/reymono)\
**Replies:** 1\
**Last updated:** [October 27, 2023, 2:42am UTC](https://erlangforums.com/t/maps-decade-old-example/2982 "2023-10-27T02:42:05Z")

</div>

Reading a tutorial and found this 10 years old example (my shell): Eshell V14.0.2 (press Ctrl+G to abort, type help(). for help) 1\> Henry8 = #{ class =\> king, born =\> 1491, died =\> 1547}. #{died =\> 1547,class =\> king,bo…

---

## [Origins of Erlang collection data structures?](https://erlangforums.com/t/origins-of-erlang-collection-data-structures/2614)

<div class="topic-metadata">

**Author:** [@itsok](https://erlangforums.com/u/itsok)\
**Replies:** 3\
**Last updated:** [May 22, 2023, 12:17pm UTC](https://erlangforums.com/t/origins-of-erlang-collection-data-structures/2614 "2023-05-22T12:17:43Z")

</div>

This is a question for someone who is familiar with origins of Erlang or design of programming languages in general and reasoning behind some of the fundamental decisions behind Erlang. I’m secretly hoping I might be pri…

---

## [Idea: optional map values](https://erlangforums.com/t/idea-optional-map-values/2385)

<div class="topic-metadata">

**Author:** [@asabil](https://erlangforums.com/u/asabil)\
**Replies:** 4\
**Last updated:** [February 21, 2023, 3:19am UTC](https://erlangforums.com/t/idea-optional-map-values/2385 "2023-02-21T03:19:21Z")

</div>

Hi, I would like to suggest an extension to the maps construction syntax to allow for the following: #{ key1 =\> Value1, key2 =\> Value2 when Guard } key2 would not be included in the map if the guard expression fai…

---

## [Maps\_in - An Erlang library to handle nested maps](https://erlangforums.com/t/maps-in-an-erlang-library-to-handle-nested-maps/2013)

<div class="topic-metadata">

**Author:** [@williamthome](https://erlangforums.com/u/williamthome)\
**Replies:** 6\
**Last updated:** [November 15, 2022, 1:47am UTC](https://erlangforums.com/t/maps-in-an-erlang-library-to-handle-nested-maps/2013 "2022-11-15T01:47:12Z")

</div>

Hello! maps\_in is a library to handle nested maps. It contains almost the same functions as the standard maps module, the difference is that the key is always a list, for example: get/2 1\> Map = #{my =\> #{nested =\> ma…

---

## [Why pattern matching on map key in function arguments causes an unbound error?](https://erlangforums.com/t/why-pattern-matching-on-map-key-in-function-arguments-causes-an-unbound-error/1979)

<div class="topic-metadata">

**Author:** [@williamthome](https://erlangforums.com/u/williamthome)\
**Replies:** 2\
**Last updated:** [October 26, 2022, 3:42pm UTC](https://erlangforums.com/t/why-pattern-matching-on-map-key-in-function-arguments-causes-an-unbound-error/1979 "2022-10-26T15:42:17Z")

</div>

Can someone explain why the pattern match in function arguments on map keys is invalid? e.g.: 1\> F = fun(#{key := Key}, #{Key := Value}) -\> Value end. \* 1:16: variable 'Key' is unbound But this is valid: 2\> F = fun(#{…

---

## [Use of maps for GenServer state variables](https://erlangforums.com/t/use-of-maps-for-genserver-state-variables/1157)

<div class="topic-metadata">

**Author:** [@phild](https://erlangforums.com/u/phild)\
**Replies:** 4\
**Last updated:** [March 22, 2022, 10:24am UTC](https://erlangforums.com/t/use-of-maps-for-genserver-state-variables/1157 "2022-03-22T10:24:41Z")

</div>

Tangentially related to Handling options in Erlang/OTP APIs - Chat / Discussions - Erlang Forums. The convention is generally to use locally defined records for state in GenServers (et al.) Are most developers persisti…

---

## [Do we really need nil values in maps?](https://erlangforums.com/t/do-we-really-need-nil-values-in-maps/370)

<div class="topic-metadata">

**Author:** [@Oliver](https://erlangforums.com/u/Oliver)\
**Replies:** 25\
**Last updated:** [November 12, 2021, 4:29am UTC](https://erlangforums.com/t/do-we-really-need-nil-values-in-maps/370 "2021-11-12T04:29:56Z")

</div>

I’m struggling in elixir with the behavior of keys and nil values. But I see that the origin of the problem is partially in how Erlang defines maps: 1\> Val = #{}. #{} 2\> Input@1 = case Val of 2\> #{‘daps-PowerCoor…
