Skip to content

Update website docs/examples for or types and the result/option removal - #3113

Merged
BaseMax merged 5 commits into
mainfrom
feat/or-types-website
Nov 11, 2026
Merged

BaseMax merged 5 commits into
mainfrom
feat/or-types-website

Conversation

@BaseMax

@BaseMax BaseMax commented Nov 11, 2026

Copy link
Copy Markdown
Member

Summary

Stacked on #3112 (needs it merged first, since these examples use the new or-type syntax and the core-hosted Option).

  • Removes the std/result and std/option doc pages (std/06-result.txt, std/07-option.txt) and their std-examples/ directories.
  • Adds a new "Or types" section to the custom-types lesson (en+fa), replacing the separate "Variant" section with one that only shows the or syntax.
  • Adds an "Option" section to std/01-core.txt (en+fa) documenting Option<T>/Some/None/etc. now that they live in std/core.
  • Ports every example that used option./result./Variant<...> onto core.*, T?, or A or B, with every .salam/.out pair regenerated from a real run.

Test plan

…re it over writing Variant<> directly

Removes std/result and std/option: Option<T> (Some/None/IsSome/IsNone/UnwrapOr/Unwrap/Expect) moves into std/core, and user code gets its own Ok/Err enum or throws/try/catch for error returns instead of a stdlib Result.
…d std/option removal

Deletes the std/result and std/option doc pages and std-examples, adds docs and examples for 'or' types and for Option living in std/core, and ports every affected example off the removed packages and off explicit Variant<> syntax.
@BaseMax
BaseMax requested a review from a team as a code owner November 11, 2026 10:47
Copilot AI balanced review requested due to automatic review settings November 11, 2026 10:47
@vercel

vercel Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
salam Ready Ready Preview Nov 11, 2026 12:06pm UTC

@coderabbitai

coderabbitai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@BaseMax
BaseMax merged commit ba091ad into main Nov 11, 2026
5 of 8 checks passed
@BaseMax
BaseMax deleted the feat/or-types-website branch November 11, 2026 10:52
@github-actions

Copy link
Copy Markdown
Contributor
sha=607c4bed947656f16904c3ad24c545874ccf4973

🤖 Salam AI review

Verdict: 🛠️ Changes needed before merging

commit 607c4be · 84 files · +466 −892 · model salam

Summary

This pull request updates the English and Persian website docs and examples to remove std/result and std/option, document Option in core and the new A or B or-type syntax, and port affected examples accordingly. The overall direction matches the stated migration, but one regenerated example output is clearly broken and must be fixed before merge.

What changed

  • Removes std/result and std/option documentation/pages and their example directories, and adds Option coverage to website/content/en/std/01-core.txt and website/content/fa/std/01-core.txt.
  • Updates learn/docs pages and example programs to use T?/core.Option and A or B or types instead of option.*, result.*, and Variant<...> (e.g. website/content/en/examples/variant.salam, website/content/en/examples/enum-or-types.salam, website/content/en/examples/core-guide-option-*.salam and their Persian counterparts).
  • Refreshes db-sql-related docs/examples to reflect nullable columns as T? (e.g. website/content/en/std/102-db-sql.txt, website/content/en/examples/db-sql-guide-generate.out, website/content/fa/examples/db-sql-guide-analyze.out).

Review

  • website/content/en/examples/db-sql-guide-analyze.out (entire file, as shown in diff): The expected output was replaced with linker errors (undefined reference to _Salam_str_Replace_str_str_str, _Salam_str_EqualFold_str_str, _Salam_str_FromInt_i64, etc.) instead of the example’s program output. This makes the example incorrect/broken as documentation. Regenerate this .out from a successful run of the corresponding .salam example against the intended compiler/build (the Persian counterpart website/content/fa/examples/db-sql-guide-analyze.out shows the expected analyzed-query output).
  • Diff coverage: The provided diff is truncated in multiple places (including website/content/en/std/01-core.txt, website/content/en/std/102-db-sql.txt, and the end of website/content/en/examples/db-sql-guide-analyze.out), and several files are listed as omitted due to size/budget (e.g. website/content/fa/std/06-result.txt, website/content/fa/std/07-option.txt, website/content/fa/std/102-db-sql.txt, website/content/fa/std/43-error.txt). I could not verify removal/consistency of those specific files or the truncated sections.

Tests

  • The PR description states every touched .salam example was run and .out files matched; however, the committed website/content/en/examples/db-sql-guide-analyze.out contradicts that for this file. Please re-run/regenerate and confirm this output.

Risks

  • Shipping a linker-error transcript as an example output will confuse readers and may break any website/example verification that compares .out files. Because this PR is stacked on Add 'A or B or C' union types; remove std/result and std/option #3112, it should only be merged once the dependency/compiler behavior it relies on is in place and all example outputs are valid.

⚠️ This review was written automatically by an AI and may contain mistakes. It is a helper for maintainers, not a replacement for a human review: check the code yourself before merging.

This branch was successfully deployed

1 active deployment
Preview — 607c4bed Deployed Nov 11, 2026 by vercel[bot]
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