Skip to content

fix: Prism preview/preuse infinite loop, _Nothing match - #1632

Merged
dmjio merged 1 commit into
masterfrom
fix/prism-preview-preuse
Sep 1, 2026
Merged

fix: Prism preview/preuse infinite loop, _Nothing match#1632
dmjio merged 1 commit into
masterfrom
fix/prism-preview-preuse

Conversation

@dmjio

@dmjio dmjio commented Aug 31, 2026

Copy link
Copy Markdown
Owner

preview/preuse in Miso.Lens were self-referential (asks . preview / gets . preview) instead of calling the Prism's _down field, causing a <<loop>> the moment either was invoked; (^?) inherited the same bug.

_Nothing's match function was copy-pasted from _Just (id), so it behaved identically to _Just instead of matching the Nothing case. Retyped to Prism (Maybe a) () to match conventional prism-library semantics.

Added tests alongside the existing Miso.Lens tests covering review, (^?), preview, preuse, and _Nothing.

preview/preuse in Miso.Lens were self-referential (asks . preview /
gets . preview) instead of calling the Prism's _down field, causing a
<<loop>> the moment either was invoked; (^?) inherited the same bug.

_Nothing's match function was copy-pasted from _Just (id), so it behaved
identically to _Just instead of matching the Nothing case. Retyped to
Prism (Maybe a) () to match conventional prism-library semantics.

Added tests alongside the existing Miso.Lens tests covering review, (^?),
preview, preuse, and _Nothing.
@dmjio
dmjio merged commit b4e6fc9 into master Sep 1, 2026
6 checks passed
@dmjio
dmjio deleted the fix/prism-preview-preuse branch September 1, 2026 15:57
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.

1 participant