Homogenize optics usage and add traverseTweak#528
Open
mmontin wants to merge 1 commit into
Open
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Optics ergonomics pass on the library:
traverseTweak, the effectful sibling ofoverTweak, 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.TxSkelOutmatch in GenerateTx/Input.^.,.~,%~,^?) 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.beginSearchPtobeginSearchPureso its suffix is not mistaken for theP(prism) optic-kind suffix.