Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement array patterns #1912

Merged
merged 1 commit into from
May 16, 2024
Merged

Implement array patterns #1912

merged 1 commit into from
May 16, 2024

Conversation

yannham
Copy link
Member

@yannham yannham commented May 7, 2024

Depends on #1910.

This commit adds a new class of patterns: array patterns. This is a natural extension, both syntactically and semantically, of existing data structure patterns in Nickel (in particular of records). Similarly, arrays pattern can also capture the rest of the pattern (the tail of the array that hasn't been matched yet) and bind it to a variable.

@github-actions github-actions bot temporarily deployed to pull request May 7, 2024 09:54 Inactive
@github-actions github-actions bot temporarily deployed to pull request May 7, 2024 17:24 Inactive
@github-actions github-actions bot temporarily deployed to pull request May 13, 2024 13:34 Inactive
///
/// The type of each "leaf" identifier will be assigned based on the `mode` argument. The current
/// possibilities are for each leaf to have type `Dyn`, to use an explicit type annotation, or to
/// be assigned a fresh unification variable.
Copy link
Member Author

Choose a reason for hiding this comment

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

This was somehow redundant with the documentation of the trait itself, and had not much to do here, attached to a specific implementation.

@yannham yannham marked this pull request as ready for review May 13, 2024 13:39
@github-actions github-actions bot temporarily deployed to pull request May 13, 2024 13:44 Inactive
@yannham yannham requested review from jneem and vkleen May 13, 2024 14:24
Base automatically changed from feat/pattern-guards to master May 13, 2024 15:39
Copy link

dpulls bot commented May 13, 2024

🎉 All dependencies have been resolved !

@yannham yannham mentioned this pull request May 13, 2024
This commit adds a new calss of patterns: array patterns. This is a
natural extension, both syntactically and semantically, of existing data
structure patterns in Nickel (in particular of records). Similarly,
arrays pattern can also capture the rest of the pattern (the tail of the
array that hasn't been matched yet) and bind it to a variable.
@github-actions github-actions bot temporarily deployed to pull request May 13, 2024 16:37 Inactive
@yannham yannham added this pull request to the merge queue May 16, 2024
Merged via the queue into master with commit 3af21b0 May 16, 2024
5 checks passed
@yannham yannham deleted the feat/array-patterns branch May 16, 2024 15:36
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.

None yet

2 participants