Skip to content

docs: rewrite patterns documentation#9546

Merged
orizi merged 3 commits intostarkware-libs:mainfrom
LarryArnault45:patterns
Jan 27, 2026
Merged

docs: rewrite patterns documentation#9546
orizi merged 3 commits intostarkware-libs:mainfrom
LarryArnault45:patterns

Conversation

@LarryArnault45
Copy link
Contributor

Summary

Rewrote the patterns documentation to provide a comprehensive explanation of pattern matching types, refutability, and usage examples.


Type of change

Please check one:

  • Bug fix (fixes incorrect behavior)
  • New feature
  • Performance improvement
  • Documentation change with concrete technical impact
  • Style, wording, formatting, or typo-only change

⚠️ Note:
To keep maintainer workload sustainable, we generally do not accept PRs that
are only minor wording, grammar, formatting, or style changes.
Such PRs may be closed without detailed review.


Why is this change needed?

The previous file was just a list of raw syntax examples without any explanation, making it difficult for users to understand how to use patterns effectively.


What was the behavior or documentation before?

The file contained a few lines of unexplained code snippets.


What is the behavior or documentation after?

The file now details different pattern types (wildcard, identifier, struct, enum), explains the difference between refutable and irrefutable patterns, and provides clear usage contexts for let and match.


Related issue or discussion (if any)


Additional context

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

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

@orizi made 2 comments.
Reviewable status: 0 of 1 files reviewed, 2 unresolved discussions (waiting on @LarryArnault45).


docs/reference/src/components/cairo/modules/language_constructs/pages/patterns.adoc line 1 at r1 (raw file):

= Patterns

limit lines to 100 chars.


docs/reference/src/components/cairo/modules/language_constructs/pages/patterns.adoc line 14 at r1 (raw file):

Cairo supports two categories of patterns:

* **Refutable patterns** — May fail to match (used in `match` arms)

and let ... else { ... }; statements as well. also have such examples.

@LarryArnault45
Copy link
Contributor Author

Done. Added let...else section and fixed line lengths.

@LarryArnault45 LarryArnault45 requested a review from orizi January 27, 2026 14:50
Copy link
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

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

:lgtm:

@orizi reviewed 1 file and all commit messages, made 1 comment, and resolved 1 discussion.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @LarryArnault45).

@orizi orizi enabled auto-merge January 27, 2026 15:48
Copy link
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

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

@orizi resolved 1 discussion.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @LarryArnault45).

@orizi orizi added this pull request to the merge queue Jan 27, 2026
Merged via the queue into starkware-libs:main with commit ecb5766 Jan 27, 2026
55 checks passed
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.

3 participants