Skip to content

Homogenize optics usage and add traverseTweak#528

Open
mmontin wants to merge 1 commit into
mainfrom
optics-homogenization
Open

Homogenize optics usage and add traverseTweak#528
mmontin wants to merge 1 commit into
mainfrom
optics-homogenization

Conversation

@mmontin

@mmontin mmontin commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Optics ergonomics pass on the library:

  • Add traverseTweak, the effectful sibling of overTweak, and use it to replace the repeated view/forM/set triples in the auto-filling tweaks (reference scripts, withdrawal amounts, constitution, min-Ada) with a single call over a composed traversal.
  • Use NamedFieldPuns instead of a positional TxSkelOut match in GenerateTx/Input.
  • Replace single-call infix optic operators (^., .~, %~, ^?) with their prefix equivalents (view, set, over, preview) to match the convention documented in doc/OPTICS.md, and express the one chained update in Balancing as a composition of prefix setters.
  • Rename beginSearchP to beginSearchPure so its suffix is not mistaken for the P (prism) optic-kind suffix.

Optics ergonomics pass on the library:

- Add `traverseTweak`, the effectful sibling of `overTweak`, and use it to
  replace the repeated view/forM/set triples in the auto-filling tweaks
  (reference scripts, withdrawal amounts, constitution, min-Ada) with a single
  call over a composed traversal.
- Use NamedFieldPuns instead of a positional `TxSkelOut` match in
  GenerateTx/Input.
- Replace single-call infix optic operators (`^.`, `.~`, `%~`, `^?`) with their
  prefix equivalents (`view`, `set`, `over`, `preview`) to match the convention
  documented in doc/OPTICS.md, and express the one chained update in Balancing as
  a composition of prefix setters.
- Rename `beginSearchP` to `beginSearchPure` so its suffix is not mistaken for
  the `P` (prism) optic-kind suffix.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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