Skip to content

Conversation

@ollien
Copy link
Contributor

@ollien ollien commented Oct 28, 2025

In attempting to solve #347, I ran into other problems that all felt related enough to fix at once

  1. Both put_in_map and set_map_key would produce an invalid "nested" map when inserting into an empty map (%{%{foo: bar}})
  2. Both put_in_map and set_map_key would call the updater, take its updated value, and then return the zipper at the position of the value. This was inconsistent with the non updater case (i.e. inserting a new key would point to the map itself), so I made these consistent.

I recognize #2 is technically a breaking change, but I figured this couldn't have been intentionally inconsistent. If you would prefer a deprecation/new function, let me know.

Fixes #347

Contributor checklist

Leave anything that you believe does not apply unchecked.

  • I accept the AI Policy, or AI was not used in the creation of this PR.
  • Bug fixes include regression tests
  • Chores
  • Documentation changes
  • Features include unit/acceptance tests
  • Refactoring
  • Update dependencies

@zachdaniel zachdaniel merged commit 4930cd4 into ash-project:main Oct 30, 2025
45 checks passed
@zachdaniel
Copy link
Contributor

🚀 Thank you for your contribution! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

set_map_key creates invalid nested map when setting a key

2 participants