Skip to content

Improve docs, error handling, and ergonomics#527

Merged
mmontin merged 3 commits into
mainfrom
improve-library-docs-and-ergonomics
Jun 22, 2026
Merged

Improve docs, error handling, and ergonomics#527
mmontin merged 3 commits into
mainfrom
improve-library-docs-and-ergonomics

Conversation

@mmontin

@mmontin mmontin commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Phase A — code quality:

  • AutoFilling: drop fromJust in autoFillWithdrawalAmounts, fix constitution haddock and a malformed section header.
  • Pretty/Skeleton: fix a latent fromJust crash when printing default TxSkelOpts.

Documentation:

  • Reconcile doc/BALANCING.md and doc/CHEATSHEET.md with the current API.
  • Fix source haddock typos (Output, Signatory, Skeleton).
  • Homogenize optics haddock comments across the Skeleton modules, using a verb-per-kind convention (Retrieves/Focuses on/Builds or retrieves/An isomorphism) matching doc/OPTICS.md.

Robustness / error handling:

  • Body and Certificate transaction generation now include the underlying error detail in their failure messages.
  • A ParameterChange governance action carrying a CostModels update now fails with an explicit MCEUnsupportedFeature error instead of silently dropping it.

Ergonomics:

  • Add withReferenceInput to attach a reference input to a TxSkelRedeemer, replacing the verbose set txSkelRedeemerMReferenceInputL (Just …) idiom, and update the CHEATSHEET accordingly.

mmontin and others added 3 commits June 22, 2026 16:26
Phase A — code quality:
- AutoFilling: drop fromJust in autoFillWithdrawalAmounts, fix constitution
  haddock and a malformed section header.
- Pretty/Skeleton: fix a latent fromJust crash when printing default TxSkelOpts.

Documentation:
- Reconcile doc/BALANCING.md and doc/CHEATSHEET.md with the current API.
- Fix source haddock typos (Output, Signatory, Skeleton).
- Homogenize optics haddock comments across the Skeleton modules, using a
  verb-per-kind convention (Retrieves/Focuses on/Builds or retrieves/An
  isomorphism) matching doc/OPTICS.md.

Robustness / error handling:
- Body and Certificate transaction generation now include the underlying
  error detail in their failure messages.
- A ParameterChange governance action carrying a CostModels update now fails
  with an explicit MCEUnsupportedFeature error instead of silently dropping it.

Ergonomics:
- Add withReferenceInput to attach a reference input to a TxSkelRedeemer,
  replacing the verbose set txSkelRedeemerMReferenceInputL (Just …) idiom, and
  update the CHEATSHEET accordingly.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Use strict foldl' for accumulating folds that build maps/values:
  mcstToUtxoState (State), the withdrawals iso and ToValue instance
  (Withdrawal), and the mints policy-tokens setter and iso (Mint). This
  avoids building up thunks in the accumulator.
- DoubleSat.deltaBalance now tests input membership with Map.member instead
  of `elem` over Map.keys, removing an intermediate list and giving O(log n)
  lookups.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- doc/OPTICS.md: document the per-kind Haddock comment convention used for
  optics across the Skeleton modules (verb determined by the optic kind).
- Body and Certificate transaction generation now signal their translation
  failures with an explicit `throw (MCEFailure …)` instead of relying on the
  `Fail` effect, addressing the two long-standing TODOs at these sites.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@mmontin mmontin marked this pull request as ready for review June 22, 2026 16:59
@mmontin mmontin merged commit 5f021c0 into main Jun 22, 2026
8 checks passed
@mmontin mmontin deleted the improve-library-docs-and-ergonomics branch June 22, 2026 19:37
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