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

Using .. for Open Record Patterns/Destructuring #7095

Open
Tracked by #7091
smores56 opened this issue Sep 18, 2024 · 2 comments
Open
Tracked by #7091

Using .. for Open Record Patterns/Destructuring #7095

smores56 opened this issue Sep 18, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers hacktoberfest

Comments

@smores56
Copy link
Collaborator

smores56 commented Sep 18, 2024

We want to start using the below syntax for open/constrained records:

{ a, b, .. } = data

and the following for closed records:

{ a, b } = data

This facilitates Roc devs being able to define closed records that will raise type errors if the destructured values get additional fields added. This is not possible in Roc today.

This change will probably break a good deal of existing Roc code that assumes that { a, b } destructures are open records, but the direction of this change precludes the ability to facilitate the transition with smart parsing + formatting.

@smores56 smores56 added enhancement New feature or request good first issue Good for newcomers labels Sep 19, 2024
@mitulagr2
Copy link

I'll take this if you'd like!

@smores56
Copy link
Collaborator Author

@mitulagr2 great! I've assigned it to you and thrown on the "Hacktoberfest" label. Let me know here or on the Zulip if you have any questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers hacktoberfest
Projects
None yet
Development

No branches or pull requests

2 participants