Repository navigation
Route zipped relations through the foreach extension point - #396
Merged
Merged
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The shared Fetch regression uses JVM-only unsafeRunSync, breaking Scala.js test compilation.
1 open issue
What changed in this PR
Replaces erased zip traversal with a typed interpreter primitive, preserving specialized batching behavior.
Changes:
- Uses typed
zipWithfor single and bulk relations in both interpreter models. - Adds batching overrides for ZQuery and Fetch.
- Adds a Fetch batching regression and test dependencies.
| File | Description |
|---|---|
| zquery/src/main/scala/decrel/reify/zquery.scala | Uses batched zip composition. |
| fetch/src/test/scala/decrel/reify/FetchZipSpec.scala | Adds a shared-datasource batching regression. |
| fetch/src/main/scala/decrel/reify/fetch.scala | Implements zip using applicative mapN. |
| core/src/main/scala/decrel/reify/monofunctor/reifiedRelation.scala | Replaces erased traversal with typed zip. |
| core/src/main/scala/decrel/reify/monofunctor/access.scala | Exposes the protected zip primitive. |
| core/src/main/scala/decrel/reify/bifunctor/reifiedRelation.scala | Replaces erased traversal with typed zip. |
| core/src/main/scala/decrel/reify/bifunctor/access.scala | Exposes the protected zip primitive. |
| build.sbt | Adds Fetch test dependencies. |
Review effort: Balanced
This was referenced Oct 17, 2026
yoohaemin
force-pushed
the
refactor/typed-interpreter-zip
branch
from
November 2, 2026 13:00
afadfe5 to
953aadd
Compare
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.

Zipped relations now combine their two branches through one internal
zipWithhelper that delegates toforeach.foreachremains the only overridable operation for combining independent effects, so bulk traversal and zipped relations cannot select conflicting batching implementations.Both interpreter models use the helper for single and bulk zips. It is package-private and final; its internal casts rely on
foreachpreserving result count and positional correspondence. The defaultforeachsequences directly withflatMapandmap, avoiding recursion through the helper. Fetch and ZQuery keep their existingforeachimplementations; no separate zip override is required.The Fetch regression exercises actual zipped relations backed by a shared datasource and checks that independent keys share one batch. The asynchronous assertion is returned to the Scala.js test runner.
Parent of #400. Review and merge this PR first; #400 builds Kyo query plans through the same
foreachextension point.Validation: core, ZQuery, and Fetch suites on Scala 2.13 and 3.3.9, plus Fetch Scala.js tests. Changed Scala sources formatted.