RepoJournal
Elixir & Phoenix

Elixir & Phoenix

Elixir, Phoenix, LiveView, and Ecto - the BEAM web stack

Pick a date

Topics: Elixir & Phoenix Full archive →

The Wire · Showcase

ELIXIR FIXES ENUM SORTER BUG THAT BROKE CUSTOM COMPARATORS

By RepoJournal · Filed · About Elixir & Phoenix

Enum.min and Enum.max were silently returning wrong results when you passed a custom sorter on ranges, and the core team just caught it.

The bug [1] is subtle but brutal: range comparisons only looked at endpoints, which works fine for natural ordering but fails completely with custom sorters. Pass `Enum.max(1..10, fn a, b -> rem(a, 5) >= rem(b, 5) end)` and you'd get 1 instead of 4. The fix now applies the custom sorter properly across the full range. Separately, three smaller but important fixes landed overnight. Duration specs [2] were incorrectly typed to forbid negative microsecond values, even though the module's own doctests produce them. Map.from_struct [4] had a typecheck issue that's now resolved. IEx completion [3] was crashing when maps contained non-atom keys, a common pattern that should never blow up the REPL.

Action items

References

  1. [1] Fix `Enum.min/2,3` and `Enum.max/2,3` with a custom sorter on ranges ↗ elixir-lang/elixir
  2. [2] Fix `Duration` specs to allow negative microsecond values (#15611) elixir-lang/elixir
  3. [3] Fix IEx completion crash on maps with non-atom keys (#15612) elixir-lang/elixir
  4. [4] Fix `Map.from_struct/1` typecheck ↗ elixir-lang/elixir

Quick answers

What shipped in Elixir & Phoenix on July 15, 2026?
Enum.min and Enum.max were silently returning wrong results when you passed a custom sorter on ranges, and the core team just caught it. In total, 8 commits and 8 pull requests landed.
Who contributed to Elixir & Phoenix on July 15, 2026?
2 developers shipped this update, including AlexGx and pnezis.
What were the notable Elixir & Phoenix updates?
Fix `Enum.min/2,3` and `Enum.max/2,3` with a custom sorter on ranges, Fix `Duration` specs to allow negative microsecond values (#15611), and Fix IEx completion crash on maps with non-atom keys (#15612).

More from Elixir & Phoenix

Daily updates, in your inbox

Follow Elixir & Phoenix

Elixir, Phoenix, LiveView, and Ecto - the BEAM web stack We'll email you a link to confirm first.

Free. Confirm via email. Unsubscribe in one click.

— or follow the whole beat:

Elsewhere on the wire