Proposal: es6_maps is merged into core

19 views
Skip to first unread message

Brandon Gillespie

unread,
Feb 5, 2026, 9:13:13 AM (3 days ago) Feb 5
to elixir-lang-core
After all the conversations over the holidays around syntax sugar with
maps, I took es6_maps out for a spin—and I have to say, I can't go back.

Why isn't this just a core thing?

It works flawlessly. Is so much simpler, and code is much more readable too.

Compare/Contrast a very basic example. Before:

```
   ...
  |> Map.reduce(%{list: [], total: 0}, fn %{house: house, count:
count}, %{list: list, total: total} ->
    %{list: [%{house: house, count: count} | list], total: total + count}
  end)
```

After:

```
   ...

  |> Map.reduce(%{list: [], total: 0}, fn %{house, count}, %{list,
total} ->
    %{list: [%{house, count} | list], total: total + count}
  end)
```

I'm just curious what the opposition is, to having es6_maps just be
merged into the mainline elixir things?

-Brandon Gillespie

José Valim

unread,
Feb 5, 2026, 10:00:14 AM (3 days ago) Feb 5
to elixir-l...@googlegroups.com
This has been discussed multiple times, certainly in the Elixir Forum but I believe in this mailing list too. I'd recommend reading the previous discussions on the topic.


--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/elixir-lang-core/fe90e58a-4668-49de-b0e6-2fc78a8d0298%40cold.org.

Brandon Gillespie

unread,
Feb 5, 2026, 10:28:15 AM (3 days ago) Feb 5
to elixir-l...@googlegroups.com

To be honest, that’s why I asked 🙂 I’m still not fully clear on what the core objection is, even after re-scanning the discussions. And some go far back, so I don't know if they are still a held opinion or not.

Is it that the es6_maps module's implementation can’t express certain things (like pinning), and this makes it an incomplete solution? Or is it simply that there is a preference around the `var:,` syntax itself?

I might be missing something, so please correct me if that’s the case. I'd rather have a partial solution that hits 90% of the use cases, and is pleasing to read, than something that is... something else (I can't find a non-offensive adjective 😂), even if it does cover a few more use cases.

But, if it does ultimately come down to your personal preference, that’s obviously a valid prerogative you have 😂.

For what it’s worth, my own reaction is that I find the second syntax pretty unpleasant to read. I realize that’s subjective, but the `var:,` form consistently looks like a lexical error to me rather than an intentional construct.

If this syntax was actually brought into core, my main concern would be whether es6_maps would continue to work cleanly after such a change — I’d strongly prefer to avoid the colon+comma form in my own codebases, if at all possible, and after how comfortable es6_maps has become in just a month of use, I'd hate to lose it.

-Brandon

Reply all
Reply to author
Forward
0 new messages