Skip to content

Rewind EmptyZipper::to_next_val to the root - #209

Merged
Adam-Vandervorst merged 1 commit into
Adam-Vandervorst:masterfrom
imlvts:fix/empty-zipper-to-next-val-rewind
Dec 1, 2026
Merged

Adam-Vandervorst merged 1 commit into
Adam-Vandervorst:masterfrom
imlvts:fix/empty-zipper-to-next-val-rewind

Conversation

@imlvts

@imlvts imlvts commented Nov 30, 2026

Copy link
Copy Markdown
Collaborator

to_next_val_observed, to_next_get_val_observed and to_next_get_val_with_witness_observed returned false/None without moving. The trait says a false return means the iteration came back around to the root, and every other zipper (the native one, PrefixZipper since 70d3dd3) ends there. This is the same class as issue #137, whose fix (b5a0fb9) covered to_next_k_path but not to_next_val.

They now rewind to the root and report the ascent to the observer. Every other iteration method already matched a read zipper over an empty map.

to_next_val_observed, to_next_get_val_observed and
to_next_get_val_with_witness_observed returned false/None without moving.
The trait says a false return means the iteration came back around to the
root, and every other zipper (the native one, PrefixZipper since 70d3dd3) ends
there.  This is the same class as issue Adam-Vandervorst#137, whose fix (b5a0fb9) covered
to_next_k_path but not to_next_val.

They now rewind to the root and report the ascent to the observer.  Every
other iteration method already matched a read zipper over an empty map.
@imlvts
imlvts marked this pull request as ready for review November 30, 2026 09:11
@Adam-Vandervorst
Adam-Vandervorst merged commit 837bd5c into Adam-Vandervorst:master Dec 1, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants