Skip to content

Require ordered sequences for bulk relation traversal - #394

Merged
yoohaemin merged 2 commits into
masterfrom
fix/ordered-bulk-collections
Nov 2, 2026
Merged

yoohaemin merged 2 commits into
masterfrom
fix/ordered-bulk-collections

Conversation

@yoohaemin

@yoohaemin yoohaemin commented Oct 17, 2026 •

Copy link
Copy Markdown
Owner

Bulk composition reconstructs optional positions and many-valued groups by position. Arbitrary Iterables can discard equal outputs (for example Set.map), invalidating those assumptions. Require immutable Seq/SeqOps collections throughout both proof models and interpreter bulk APIs.

This is a source-breaking restriction: custom applyMultiple overrides must adopt the new bounds, and callers must convert sets or arrays to List/Vector. The new bulk-collection guide documents finiteness, order, duplicate preservation, and one result per input; finiteness and custom-interpreter compliance remain caller/implementer obligations.

New tests in both models cover empty groups, duplicate outputs, optional positions, and compile-time rejection of sets. Validation: full sbt test matrix across all modules, then the new contract tests via core/test, core3/test, coreJS/test, coreJS3/test; fmt and diff checks passed.

Merge coordination: this API restriction overlaps #393, #396, and #398. Rebase it after those changes, preserving the corrected generator CC parameter, typed zip implementation, and Fetch validation. Their combined tree has passed the full test matrix, documentation compilation, and workflow checks locally.

Copilot AI balanced review requested due to automatic review settings October 17, 2026 04:03

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.

🔵 Needs a closer look

The source-breaking change spans multiple interpreters and Scala versions, and the reported test matrix remains independently unverified.

No open issues 🎉

What changed in this PR

Restricts bulk relation traversal to immutable sequences so composition preserves order, duplicates, and group boundaries.

Changes:

  • Propagates Seq/SeqOps bounds through both proof models and interpreter APIs.
  • Adds regression tests for positional behavior and compile-time rejection of sets.
  • Documents the source-breaking migration and interpreter obligations.
File Description
zquery/​src/​main/​scala/​decrel/​reify/​zquery.scala Restricts interpreter collection bounds.
zquery/​src/​main/​scala-3/​decrel/​reify/​zquerySyntax.scala Updates Scala 3 bulk syntax bounds.
zquery/​src/​main/​scala-2.13/​decrel/​reify/​zquerySyntax.scala Updates Scala 2.13 bulk syntax bounds.
ziotest/​src/​main/​scala/​decrel/​ziotest/​gen.scala Adapts generator traversal to sequences.
scalacheck/​src/​main/​scala/​decrel/​scalacheck/​gen.scala Adapts generator traversal to sequences.
mdoc/​docs/​guide/​README.md Links the collection contract guide.
mdoc/​docs/​guide/​bulk-collections.md Explains collection laws and migration.
kyo-batch/​src/​main/​scala/​decrel/​reify/​kyoBatch.scala Restricts batch interpreter collections.
fetch/​src/​main/​scala/​decrel/​reify/​fetch.scala Updates interpreter and bulk syntax bounds.
core/​src/​test/​scala/​decrel/​reify/​monofunctor/​CollectionContractSpec.scala Tests monofunctor collection contracts.
core/​src/​test/​scala/​decrel/​reify/​CommonErrorSpec.scala Migrates the custom test interpreter.
core/​src/​test/​scala/​decrel/​reify/​bifunctor/​CollectionContractSpec.scala Tests bifunctor collection contracts.
core/​src/​main/​scala/​decrel/​reify/​monofunctor/​reifiedRelation.scala Enforces and documents sequence traversal.
core/​src/​main/​scala/​decrel/​reify/​monofunctor/​proof.scala Restricts many-valued proof collections.
core/​src/​main/​scala/​decrel/​reify/​bifunctor/​reifiedRelation.scala Enforces and documents sequence traversal.
core/​src/​main/​scala/​decrel/​reify/​bifunctor/​proof.scala Restricts many-valued proof collections.

Review effort: Balanced

@yoohaemin
yoohaemin force-pushed the fix/ordered-bulk-collections branch from 302fea0 to 68623a3 Compare November 2, 2026 12:48
@yoohaemin
yoohaemin merged commit 09440ee into master Nov 2, 2026
9 checks passed
@yoohaemin
yoohaemin deleted the fix/ordered-bulk-collections branch November 2, 2026 12:53
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