Skip to content

feat(result): add typed chaining combinators and executable examples - #37

Merged
fffonion merged 11 commits into
masterfrom
feat/result-chaining
Nov 10, 2026
Merged

fffonion merged 11 commits into
masterfrom
feat/result-chaining

Conversation

@fffonion

@fffonion fffonion commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Add typed Result combinators: map, map_err, and_then, or_else, unwrap_or, and unwrap_or_else.
  • Preserve single, left-to-right receiver/argument evaluation, eager versus lazy fallback semantics, exact-error-type ?, and explicit map_err conversion.
  • Reject unsupported resource discards and temporary callable captures while preserving supported prebound callbacks and backend execution.
  • Extend RSS-to-native Rust Result regressions and provide executable Rust callback and RSS documentation examples.

Validation

  • 213 unique integration cases and 9 focused library cases passed on the reviewed head, including interpreter, native/AOT, resource, language-service, host, callback, and documentation coverage.
  • All five RSS documentation examples compile, roundtrip through VMBC, and execute; both included Rust documentation fixtures execute.
  • Formatting and full-range whitespace checks passed. Independent whole-change review found no blocking issues.
  • Strict Clippy remains nonzero on the existing library diagnostics (18 library / 20 library-test); the focused default-level documentation target has no changed-file diagnostics. This PR does not claim a strict Clippy pass.
  • The corrected default-feature cargo test --locked --workspace run passed: 2756 passed, 15 ignored. The original 222 Result cases are included, not added again.
  • The initial library failures were obsolete AST inspection/navigation in tests; the correction preserves provenance and runtime field-detachment assertions and adds a value-mode control.
  • Exact-head CI passed for both the push run and pull-request run.

Scope

Independent Option/unit schemas, host migrations, and the RSS no-null boundary are subsequent work and are not provided by this PR.

Exercise RSS-constructed Ok/Err through typed callbacks, including zero and false payloads, and keep fatal VmError on the outer channel.
Describe the existing GuestResult conversion, the separate VM error channel, and the ordinary versus VM-aware resource callback entries.
…ecks

The Result combinator parser represents .unwrap_or(..) as a ResultMethod
carrier until type resolution lowers non-Result receivers to the existing
OptionUnwrapOr nullable path. Update the stale inline harnesses in the
provenance and nested projection cases to inspect that current carrier,
preserving the original span, identity and detachment obligations, and add
a value-mode runtime control that keeps the producer-intent distinction
observable.
@fffonion
fffonion merged commit 0c3331c into master Nov 10, 2026
8 checks passed
@fffonion
fffonion deleted the feat/result-chaining branch November 10, 2026 16:05
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