Skip to content

feat!: require a seal to return synchronously - #64

Merged
jo16oh merged 5 commits into
mainfrom
feat/sync-seal
Oct 14, 2026
Merged

jo16oh merged 5 commits into
mainfrom
feat/sync-seal

Conversation

@jo16oh

@jo16oh jo16oh commented Oct 14, 2026 •

Copy link
Copy Markdown
Owner

Currently, an async seal is accepted, and it makes every derivation async:

const Reading = Val.companion<Reading>()
  .implSeal(async (r, seal) => seal(await normalize(r)))
  .impl();
Reading.seal({ n: 1 }); // Promise<Reading>
Reading.patch(reading, { n: 2 }); // Promise<Reading>
  • implSeal rejects a seal whose return type includes a PromiseLike, on a Val companion, an Enum companion and a variant: "a seal is synchronous; await before sealing"
  • A seal whose return type is any is still accepted
  • Breaking: an async seal is now rejected. Do the async work first and pass its result to the seal

@jo16oh jo16oh added the breaking changes that break consumers label Oct 14, 2026
@jo16oh
jo16oh merged commit a7c88de into main Oct 14, 2026
2 checks passed
@jo16oh
jo16oh deleted the feat/sync-seal branch October 14, 2026 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking changes that break consumers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant