Skip to content

Infer a common error type for composed relation proofs - #388

Merged
yoohaemin merged 2 commits into
masterfrom
common-error
Oct 10, 2026
Merged

yoohaemin merged 2 commits into
masterfrom
common-error

Conversation

@yoohaemin

@yoohaemin yoohaemin commented Oct 10, 2026 •

Copy link
Copy Markdown
Owner

Composed and zipped relation proofs need a shared error type that accepts failures from either child. Resolve the child proofs with independent error types, then infer the parent error type through CommonError and widen the interpreters using its subtype evidence.

Relation-level regression tests materialize single, optional, many, and zipped proofs with distinct left/right failure types. They check shared-type inference and preservation of both failures in single and batched execution, as well as successful outputs, absent optional results, and empty collections.

Validation: core tests passed on Scala 2.13 and 3.3, on JVM and Scala.js, together with fmtCheck. Proof construction is reviewed separately in #387, stacked on this branch.

@yoohaemin
yoohaemin marked this pull request as ready for review October 10, 2026 02:47
Copilot AI balanced review requested due to automatic review settings October 10, 2026 02:47

Copilot AI 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.

🟡 Changes recommended

Relation-level tests do not cover composed proofs with independent child error types.

1 open finding
What changed in this PR

Introduces shared error-type inference for composed bifunctor relation proofs.

Changes:

  • Adds CommonError subtype evidence.
  • Widens child interpreters to a shared error type.
  • Adds evidence-level regression tests.
File Description
CommonError.scala Defines common-error evidence.
bifunctor/​proof.scala Applies shared errors across composition forms.
CommonErrorSpec.scala Tests evidence inference and value preservation.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread core/src/test/scala/decrel/reify/CommonErrorSpec.scala

Copilot AI 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.

🟢 Approval recommended

The implementation consistently handles all composition variants with comprehensive cross-platform regression coverage.

0 open findings

1 resolved since last review

🧠 Review effort: Balanced

@yoohaemin
yoohaemin merged commit 7a6c7b3 into master Oct 10, 2026
10 checks passed
@yoohaemin
yoohaemin deleted the common-error branch October 10, 2026 08:02
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.

2 participants