Skip to content

Allow void-returning callbacks in transform over a copack - #440

Merged
Bronek merged 2 commits into
mainfrom
bronek/fix_void_transform_grading
Sep 29, 2026
Merged

Bronek merged 2 commits into
mainfrom
bronek/fix_void_transform_grading

Conversation

@Bronek

@Bronek Bronek commented Sep 28, 2026

Copy link
Copy Markdown
Member

Allow void callbacks in copack transform, representing their results as pack<>. All-void callbacks yield copack<pack<>>. This also applies through carriers and to transform_error over a copack error.

Add expected<void, E>::copack_value(). Convert callback results before spliced arguments expire, and include explicit result conversions in noexcept.

Mutable operands can select a void overload where they previously fell back to a valued const overload. At this point in the stack, void transforms require <fn/pack.hpp> as well as <fn/copack.hpp>.

Assisted-by: Claude:claude-opus-5-5
Assisted-by: Codex:gpt-6-astra

@augmentcode

augmentcode Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: This PR enables void-returning callbacks when mapping a copack.

Changes:

  • Normalizes each `void` branch result to the unit product, `pack<>`.
  • Produces `copack>` for all-void mappings and a normalized mixed copack otherwise.
  • Routes transform results through an injector before spliced arguments can expire.
  • Updates `noexcept` evaluation to include callback-result conversion.
  • Preserves mutable-overload selection across the new conversion layer.
  • Adjusts folded spliced rvalues so `pack` stores them by value.
  • Adds `expected::copack_value()` and broadens the free lift.
  • Extends carrier and `transform_error` coverage for copack-backed sides.
  • Updates API reference material, changelog history, and focused tests.
Technical notes: The unit representation requires `pack` to be available when a void copack transform is instantiated.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 1 suggestion posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread CHANGELOG.md
@Bronek
Bronek added this pull request to stack #445 September 28, 2026 20:14
@Bronek
Bronek force-pushed the bronek/fix_void_transform_grading branch from 5e5ffac to 145adda Compare September 28, 2026 20:38
@codecov

codecov Bot commented Sep 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Bronek

Bronek commented Sep 29, 2026

Copy link
Copy Markdown
Member Author

augment review

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. No suggestions at this time.

Comment augment review to trigger a new review at any time.

@Bronek
Bronek force-pushed the bronek/fix_void_and_then_grading branch from 0f78acb to 58635ef Compare September 29, 2026 21:12
@Bronek
Bronek removed this pull request from stack #445 September 29, 2026 21:20
@Bronek
Bronek added this pull request to stack #446 September 29, 2026 21:21
@Bronek
Bronek removed this pull request from stack #446 September 29, 2026 21:24
@Bronek
Bronek changed the base branch from bronek/fix_void_and_then_grading to main September 29, 2026 21:24
Represent void callback results as pack<> in the result copack, including
transform_error over a copack error. Add copack_value() for expected<void, E>.

Convert results before spliced arguments expire and include the selected
overload's explicit conversion in noexcept. Mutable operands can now select
a void overload where they previously fell back to a valued const overload.

Assisted-by: Claude:claude-opus-5-5
Assisted-by: Codex:gpt-6-astra
Store rvalue operands by value when the apply fold constructs a pack,
matching as_pack. This avoids forming the forbidden pack<T&&>, which
prevented transforming an rvalue copack with a following pack argument.
It also fixes MSVC's failure when checking the const&& transform overload
for an lvalue call.

Assisted-by: Claude:claude-opus-5-5
Assisted-by: Codex:gpt-6-astra
@Bronek
Bronek force-pushed the bronek/fix_void_transform_grading branch from c0abe37 to 1ffad00 Compare September 29, 2026 21:30
@Bronek
Bronek merged commit 5f44599 into main Sep 29, 2026
54 checks passed
@sonarqubecloud

Copy link
Copy Markdown

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